import re
import requests
import execjs
session = requests.session()
def get_sojson():
url = 'http://www.ahtba.org.cn/'
content = session.get(url).text
if 'sojson.v5' in content:
js = re.findall('''<script type="text/javascript">(.*?)</script>''', content, re.S)[0]
del_js = re.findall('''_0x33f22a\(\);;if\(!\(typeo.*?sojson.v5';''', js, re.S)[0]
replace_js = re.findall('''else{(window.*?=)''', js, re.S)[0]
so_json = js.replace(del_js, '').replace(replace_js, 'return ')
return get_content(so_json)
return content
def get_content(js):
so_json = execjs.compile(js)
url = 'http://www.ahtba.org.cn' + so_json.call('_0x33f22a')
content = session.get(url).text
print(content)
return content
if __name__ == '__main__':
while 1:
get_sojson()
安徽招投标soJson加密
最新推荐文章于 2023-03-28 01:12:38 发布