python中使用requests 模拟浏览器发送请求数据
2018-01-12 00:23
876 查看
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模拟浏览器登录人人网,并使用代理IP和发送表单数据
- 干货 | 如何使用Python模拟客户端发送http2.0请求?
- pyhon3模拟登录百度(2)—— 使用IE11理清百度登录内部逻辑和分析请求发送数据
- Python 使用requests发送POST请求
- Python中使用socket发送HTTP请求数据接收不完整问题解决方法
- 使用python的requests 发送multipart/form-data 请求
- Python 使用requests发送POST请求
- 介绍一款chrom浏览器插件 DHC是一款使用chrome模拟REST客户端向服务器发送测试数据的谷歌浏览器插件
- 使用python的requests 发送multipart/form-data 请求
- Python中使用socket发送HTTP请求数据接收不完整问题解决方法
- python下如何使用requests发送multi-part类型的数据
- Python使用requests发送POST请求实例代码
- 使用HttpClient配置代理服务器模拟浏览器发送请求调用接口测试
- 发送异步请求获取数据时,不使用客户端浏览器缓存
- 使用C#访问百度指数:模拟发送请求/得到响应数据(2)
- python requests 自动管理 cookie 。 get后进行post发送数据---》最简单的刷票
- Android开发使用GET方式向服务器请求和发送数据
- httpClient使用,1 发送post请求 2 发送get请求取得接口中的数据
- 使用 HttpWebRequest 发送模拟 POST 请求
- 使用xutils发送POST请求,携带json和图片二进制文件数据获取服务器端返回json数据