requests.utils.dict_from_cookiejar
:把cookiejar对象转化为字典
import requests
url = "http://www.baidu.com"
response = requests.get(url)
print(type(response.cookies))
cookies = requests.utils.dict_from_cookiejar(response.cookies)
print(cookies)
requests.utils.dict_from_cookiejar
:把cookiejar对象转化为字典
import requests
url = "http://www.baidu.com"
response = requests.get(url)
print(type(response.cookies))
cookies = requests.utils.dict_from_cookiejar(response.cookies)
print(cookies)