python requests session手动添加cookies

仲孙翔飞
2023-12-01

python requests session手动添加cookies

import requests

s = requests.session()
#手动添加键为__jsl_clearance_s的cookie
requests.utils.add_dict_to_cookiejar(s.cookies,{'__jsl_clearance_s':jsl_clearance_s})
#带着刚才添加好的cookie去请求
response = s.get(url,headers=headers)

 

 类似资料: