先上个爬取的结果图
最后的结果为每部漫画按章节保存
运行环境
ide vs2019
python3.7
chrome、chromedriver
chrome和chromedriver的版本需要相互对应
先上代码,代码非常简短,包含空行也才50行,多亏了python强大的库
import os
import time
import requests
from selenium import webdriver
from lxml import etree
def getchapterurl(url):
headers = {
"user-agent": "mozilla/5.0 (macintosh; intel mac os x 10_13_4) applewebkit/537.36 (khtml, like gecko) chrome/66.0.3359.139 safari/537.36"
}
part_url = "http://ac.qq.com"<