#1.同步爬取小说各页下载链接
import time
start_time=time.time()
import requests
from lxml import etree
from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor
import os
url="https://www.soshuw.com/GuiMiZhiZhu/"
x1="//div[@id='novel50348']/dl/dd/a[1]/@href"
#添加verify=False可防止报错,例如SSL
r=requests.get(url,timeout=30,verify=False)
r.encoding="utf-8"
r=r.text
selector = etree.HTML(r)
#提取小说各页对应的url
t_url=str(selector.xpath(x1))
t_url=t_url.replace(t_url[0],"").replace
异步下载小说《诡秘之主》
最新推荐文章于 2024-08-14 23:30:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)