吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 639|回复: 5
收起左侧

[经验求助] python requests 获取cookie问题

[复制链接]
夜色初晨 发表于 2023-2-14 16:30
100吾爱币
输出cookies只能获取到ASP.NET_SessionId
其他的_clck,_clck,_ga_SB6TK93GYC,_gat_UA-88188333-1之类的输出不出来
比如说需要获取到这些
cookies = {    'ASP.NET_SessionId': 'hy4rov0efvr3vgnvdxsixfw4',    '_ga_SB6TK93GYC': 'GS1.1.1676361266.1.1.1676361866.44.0.0',    '_gcl_au': '1.1.546203804.1676361266',    '_ga': 'GA1.2.724662390.1676361267',    '_gid': 'GA1.2.371598168.1676361267',    '_fbp': 'fb.1.1676361268693.367426536',    '_clck': '1jgz2ut|1|f94|0',    '_clsk': 'f3j3rf|1676361856300|20|1|k.clarity.ms/collect',    '_gat_UA-88188333-1': '1',}
但是输出session.cookies只有一个ASP.NET_SessionId。各位大佬,有什么办法能够获取到这些请求coo信息吗?

最佳答案

查看完整内容

你这个应该是headers吧?cookie一般就只'cookie': 'xxxxxxxx'的呀!你试试session.headers

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

额微粒波地 发表于 2023-2-14 16:30
你这个应该是headers吧?cookie一般就只'cookie': 'xxxxxxxx'的呀!你试试session.headers
yhlg 发表于 2023-2-14 17:08
homehome 发表于 2023-2-14 22:05
这有何难的,chatGPT聊一下就可以有答案。比如我聊的
Create a python program, which can obtain the cookies of the website
import requests
#Website URL
url = "example.com"
#Request the page
r = requests.get(url)
#Get the cookie details
cookies = r.cookies
#Print the cookie details
for cookie in cookies:
    print(cookie, cookies[cookie])
dft2010 发表于 2023-2-14 22:49
你不把地址发出来干聊啊
 楼主| 夜色初晨 发表于 2023-2-15 16:29
问题已解决,出在表单验证上了
返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-5-18 00:10

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表