标签:pytho request imp cts util gecko rect gen apple
import requests
url = ‘http://xxxxxxxx.com‘
headers = {
‘User-Agent‘: ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36‘,
}
res = requests.get(url=url, headers=headers, allow_redirects=False)
# allow_redirects=False 为禁止重定向,可以抓取返回协议头
print(res.cookies)
print(res.headers)
print(res.text)
print(res.content)
cookies_dict = requests.utils.dict_from_cookiejar(res.cookies)
标签:pytho request imp cts util gecko rect gen apple
原文地址:https://www.cnblogs.com/zjj999/p/12579590.html