s.get('https://test.com',auth=('user','test'))
x=s.cookies
print(x)
这是我的代码,输出是
<RequestsCookieJar[<Cookie __cfduid=asdasd1232fgdb323123 for .testcom/>, <Cookie JSESSIONID=123fdf54fgfa for test.com/gpcs-web-war>]>
现在,我想获得 cfduid 和 JSESSIONID 如何从输出中提取?
答案 0 :(得分:0)
在 .get_dict()
上使用 s.cookies
,然后使用 []
表示法提取值。
例如:
s.cookies.get_dict()["JSESSIONID"]