1. url:http://www.300600900.cn/html
2. target:session
3. 簡單分析函數
偶然發現,這個網站的加密,和landChina加密如出一轍,js函數的名字都同樣。。。因此,只貼出一些代碼,有興趣能夠參考:post
4. 代碼:學習
from afterWork.config import userAgent, proxies import requests import re import execjs targetUrl = 'http://www.300600900.cn/' sess = requests.session() res = sess.get(url=targetUrl) # print(res.text) # 執行js with open('jsCode.js', 'r') as f: jsCode = f.read() ctx = execjs.compile(jsCode) result = ctx.call('YunSuoAutoJump') # print(result) secondUrl = 'http://www.300600900.cn' + result # print(secondUrl) _ = sess.get(url=secondUrl) res3 = sess.get(url=targetUrl) # print(res3.encoding) res3.encoding = 'UTF-8' # print(res3.text) regForInfo = r'<h2>(.*?)</h2>' productList = re.findall(regForInfo, res3.text) for info in productList: print(info)
結果:網站
學習交流,勿做他用。加密