python获取set-cookies

2019-07-01 18:24:04 浏览数 (1)

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'}

0 人点赞