2020
12-07
12-07
python 爬取小说并下载的示例
代码importrequestsimporttimefromtqdmimporttqdmfrombs4importBeautifulSoup"""Author:JackCuiWechat:https://mp.weixin.qq.com/s/OCWwRVDFNslIuKyiCVUoTA"""defget_content(target):req=requests.get(url=target)req.encoding='utf-8'html=req.textbf=BeautifulSoup(html,'lxml')texts=bf.find('div',id='content')content=texts.text.strip().split('\xa0'*4)returnconte...
继续阅读 >