js加密(五)产品目录

1.  url:http://www.300600900.cn/html

2. target:session

 

 

 

 3. 简单分析函数

偶然发现,这个网站的加密,和landChina加密如出一辙,js函数的名字都同样。。。因此,只贴出一些代码,有兴趣能够参考:post

js加密(四)landChina

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)

结果:网站

 

 学习交流,勿做他用。加密

相关文章
相关标签/搜索