1 Star 0 Fork 2

伟浩 / jiasule

forked from 于佳 / jiasule 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
crack.py 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
于佳 提交于 2020-07-28 14:37 . 修改
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: jiajia
@file: crack.py
@time: 2020/7/28 14:11
"""
import re
import execjs
import requests
url = 'http://www.gsxt.gov.cn/index.html'
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36"
}
response = requests.get(url, headers=headers)
jsluid_h = response.headers['Set-Cookie'].split('=')[1].split(';')[0]
data = response.text
js = re.findall('<script>(.*?)</script>', data)[0]
with open(r'jiasule.js', encoding='utf-8') as f:
wc_js = f.read()
ctx = execjs.compile(wc_js)
jsl_cookie = ctx.call('jsl', js)
jsl_clearance = re.findall('=(.*?);', jsl_cookie)[0]
print(jsluid_h)
print(jsl_clearance)
#### test ######
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36",
"Cookie": f"__jsluid_h={jsluid_h}; __jsl_clearance={jsl_clearance}"
}
response = requests.get(url, headers=headers)
print(response.text)
print(response)
Python
1
https://gitee.com/wangwox_admin/jiasule.git
git@gitee.com:wangwox_admin/jiasule.git
wangwox_admin
jiasule
jiasule
master

搜索帮助