安徽招投标soJson加密

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()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值