介绍 |
python爬取138看书网小说源码 v2.9 龙跃凤鸣想得混乱(胡思乱想万无一失)31. 又到草黄时节。遍野的绿色斑驳着消失,只有那干枯的浅黄渐次布满了人的视线,是生命终结时最柔韧的余唱。80. I was deeply moved by the young boy, because I know Lei Feng is still living in our hearts.317.循序而渐进,熟读而精思。《读书之要》 python爬取138看书网小说源码由论坛用户制作并分享,适用于138小说网,能够帮助用户爬取网站获取小说资源,软件提供分类搜索查找的功能,支持目录爬取,还附带书签功能,用户使用这款软件能够更加轻松地看小说,非常实用。 软件说明 记录一下今天爬的第二个小说网,第二次弄起来比较熟练了,不像第一次弄一半就得找教程边看边搞。 但实际上爬小说应该是最简单的事情了吧,涉及的技术也没有那么深。 把代码发出来让想刚入门却不知道从何下手的同萌新们看看吧,看教程总是云里雾里的,还是还得上手多练练才能加深印象。 这个小说爬虫还是有点垃圾32. 失恋后不要放弃对爱情的追求,失恋后就想独身一辈子,这是不现实的。没有爱情的人生是不完美的,应该继续去叩响爱情的大门。,多线程没有,而且有些函数也是用的跟*一样,这玩意该怎么改进也没有头绪。  演示一览 import requests import lxml import re headers = { 'user-agent': 'User-AgentMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36' } print ('本脚本仅适用于138看书网:https://www.13800100.com/') #url_list = 'https://www.13800100.com/list/72262/' url_list = (input('粘贴小说目录url,必须是小说目录,小说首页不支持
')) downurl = 'https://www.13800100.com/article/' url_list = requests.get(url_list) text_list = url_list.text #爬小说书名 text_title = re.findall(r' (.*?)',text_list,re.S)[0] text_title = text_title.replace('
','') text_title = text_title.replace(' ','') text_title = text_title.replace(' ','') #爬小说目录列表 text_list_info = re.findall(r' .*? ',text_list,re.S)[0] text_list_info = re.findall(r'(.*?)',text_list) for i in text_list_info: #每章小说的url和每章章名 list = i[0] name = i[1] download = downurl + list download_info = requests.get(url = download,headers=headers) html=download_info.text html_info = re.findall(r' (.*?) ',html,re.S)[0] html_info = html_info.replace (' ','') html_info = html_info.replace (' ',('
')) html_info = html_info.replace (' ','') print (name) #输出为记事本 with open ('%s.txt' % text_title,'a+',encoding = 'utf-8')as f: f.write(' '+ name + '
') f.write('
') f.write(html_info + '
') f.write('
') print ('下载完成') 上文就是小编为您带来的python爬取138看书网小说源码了,更多精彩软件请多多关注101bt软件下载网。 烛影摇红 张抡299李商隐:寄令狐郎中python爬取138看书网小说源码It is true that (True, / To be sure, / Admittedly,)…, but this is not to say (it is unlikely / it doesn’t follow / it doesn’t mean / it won’t be the case) that… |