@
676529483 很简单的 python 脚本
----------------------------------------------------------------------------------------------------------------------------------------------
#coding=utf-8
import requests
import re
print('数据来源于
https://www.biqubao.com/ 如需到此网更新书籍')
bookurl = input('该本小说网站(直接回车自动跳转一本):')
if bookurl == '':
bookurl = '
https://www.biqubao.com/book/34203/'homeurl = '
https://www.biqubao.com/'A = requests.get(bookurl).content.decode('gb2312')
B = re.split(r'<dd><a href=|</a></dd>',A)
PAGE = []
for html in B:
if 'html' in html and '\n' not in html:
PAGE.append(html)
def page_new(P):
PP=int(P)-1
ok = re.split(r'"/|">',PAGE[PP])
oneurl = homeurl+ok[1]
print('_'*70)
print('|'+ok[2]+oneurl)
D = requests.get(oneurl).content.decode('gb2312')
E = re.split(r'<br />| |</div>|<h1>|</h1>|\n',D)
for text in E:
if text !='' and '<a href=' not in text:
really = 0
for i in text:
if '\u4e00' <= i <= '\u9fff':
really +=1
if really > 0:
print('|'+text)
print('——'*15)
textpage = 0
if __name__ == '__main__':
while True:
old = textpage
textpage = input('跳转书页|回车下一章 next>>')
if textpage == '':
textpage = int(old) +1
page_new(textpage)