python之 url格式转换

Python requests cookie格式转换

import requests


cookies = 'll="108288"; bid=NodlXzfaH_o; __gads=ID=0af91ce932c6d12c-22c34cfa8fc90047:T=1624027452:RT=1624027452:S=ALNI_MYs2I1EtkmfR1_-nvFPUE58Xuzvwg; douban-fav-remind=1; viewed="35118043"; gr_user_id=bbba787a-8040-4d2a-99c9-0e7205d55631; __utmz=30149280.1628424734.8.6.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmc=30149280; ap_v=0,6.0; push_doumail_num=0; push_noty_num=0; __utmv=30149280.17020; __yadk_uid=Uk2xTm3EEqSEfelnBcfkvNx941OBBMdi; dbcl2="170209839:UMNN1t0Q5hc"; ck=EP97; _pk_ref.100001.8cb4=%5B%22%22%2C%22%22%2C1628429455%2C%22https%3A%2F%2Faccounts.douban.com%2F%22%5D; _pk_ses.100001.8cb4=*; __utma=30149280.1778247111.1624027427.1628424734.1628429495.9; __utmt=1; _pk_id.100001.8cb4=9e98f5fdb9dc0e4d.1624027404.6.1628429843.1628427334.; __utmb=30149280.6.10.1628429495'

cookies_jar = requests.cookies.RequestsCookieJar()

for cookie in cookies.split(';'):
    key, value = cookie.split('=', 1)
    cookies_jar.set(key, value)

res = requests.get(url, headers=headers,cookies=cookies_jar)

如果您喜欢本站,点击这儿不花一分钱捐赠本站

这些信息可能会帮助到你:下载帮助 | 报毒说明 | 进站必看

修改版本安卓软件,加群提示为修改者自留,非本站信息,注意鉴别

(0)

发表回复

评论问题之前, 点击我,能帮你解决大部分问题

评论列表(0条)

请用支付宝扫一扫完成支付