Skip to content

参考资料:商丘市教育体育局鼠标移动设置Cookie #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
s0ing opened this issue Apr 17, 2025 · 0 comments
Open

参考资料:商丘市教育体育局鼠标移动设置Cookie #18

s0ing opened this issue Apr 17, 2025 · 0 comments

Comments

@s0ing
Copy link

s0ing commented Apr 17, 2025

# -*- coding: utf-8 -*-
"""
file: demo.py
create: 2025/4/17 17:55
author: s0ing
summary: 
"""
import re

import requests

headers = {
    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Pragma": "no-cache",
    "Referer": "https://jytyj.shangqiu.gov.cn",
    "Sec-Fetch-Dest": "document",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "same-origin",
    "Sec-Fetch-User": "?1",
    "Upgrade-Insecure-Requests": "1",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36",
    "sec-ch-ua": "\"Google Chrome\";v=\"135\", \"Not-A.Brand\";v=\"8\", \"Chromium\";v=\"135\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\""
}
url = "https://jytyj.shangqiu.gov.cn"
response = requests.get(url, headers=headers)

TWAF_AR = re.findall('TWAF_AR=(.*?);', response.text)[0]
print(TWAF_AR)

cookies = {
    "Power::SiteUniqueVisitorKey": "/49/",
    "TWAF_AR": TWAF_AR
}
url = "https://jytyj.shangqiu.gov.cn/zwgk/fdzdgknr/zfcg31sqsjytyj/zbgg31sqsjytyj"
response = requests.get(url, headers=headers, cookies=cookies)

print(response.text)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant