Skip to content

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

Description

@s0ing
# -*- 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions