python requests包用法

1 先创建session , 设置header. 调用get()函数

s = requests.session()
headers = {
‘Accept‘:‘image/webp,image/*;q=0.8‘,
‘User-Agent‘:‘News/6.9.8.36 CFNetwork/975.0.3 Darwin/18.2.0‘,
‘Accept-Language‘:‘zh-cn‘
}
s.headers.update(headers)

s.get(url=url,params=params,verify=False)

2 直接调用get

requests.get(url, headers=headers, proxies=proxies).text