python获取set-cookies
代码语言:javascript复制#!/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)
代码语言:javascript复制{'BDORZ': '27315'}