python获取set-cookies
python获取set-cookies
#!/usr/bin/python3.4
# -*- coding: utf-8 -*-
import requests
url = "https://www.baidu.com/"
session = requests.session()
session.get(url)
html_set_cookie = requests.utils.dict_from_cookiejar(session.cookies)
print(html_set_cookie)
{'BDORZ': '27315'}