神剑山庄资源网 Design By www.hcban.com

如下所示:

import requests

url='http://####'
proxy={'http':'http://####:80'}
headers={
  "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  "Accept-Encoding": "gzip, deflate, br",
  "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
  "Connection":"keep-alive",
  "Host":  "36kr.com/newsflashes",
  "Upgrade-Insecure-Requests":"1",
  "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:55.0) Gecko/20100101 Firefox/55.0"
}
respone=requests.get(url,timeout=10,headers=headers,proxies=proxy)
print(respone.status_code)

以上这篇在python中使用requests 模拟浏览器发送请求数据的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

标签:
python,requests,浏览器,请求

神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网 免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com

评论“在python中使用requests 模拟浏览器发送请求数据的方法”

暂无在python中使用requests 模拟浏览器发送请求数据的方法的评论...