小说只爬取了59章还有其他目录页没有爬取,
目录页总共11页只爬取了1页
```python
import requests
from lxml import etree
url='https://www.qb5200.la/book/116524/'
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'}
res=requests.get(url,headers=headers)
html=etree.HTML(res.text)
chapter_name=html.xpath("//*/dl[@class='zjlist']/dd//text()")
href=html.xpath("//*/dl[@class='zjlist']/dd/a/@href")
base_url="https://www.qb5200.la/book/116524/"
for i in range(len(chapter_name)):
data=requests.get(base_url+href[i],headers=headers)
html=etree.HTML(data.text)
content=html.xpath("//*/div[@id='content']//text()")
with open(f'e:/123/{chapter_name[i]}.txt', 'w',encoding="utf-8") as f:
for d in content:
f.write(d.replace("\xa0\xa0\xa0\xa0",'\n'))
```