[Python] 纯文本查看 复制代码 import execjs
import requests
with open('1.js','r') as fp:
ctx = execjs.compile(fp.read())
a = ctx.call('dm5imagefun')
headers = {
'Referer': 'http://www.dm5.com/m11076-p2/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3756.400 QQBrowser/10.5.4039.400'
}
for i,url in enumerate(a):
res = requests.get(url, headers=headers)
with open(f'{i}.jpg', 'wb') as fpp:
fpp.write(res.content)
1.js 文件是http://www.dm5.com/m11076-p2/chapterfun.ashx?cid=*******这个请求获取的,这个请求在chapternew_v22.js中发送。
这样可以直接获取所有的链接url |