1. 首页
  2. 数据库
  3. 其它
  4. python requests使用socks5的例子

python requests使用socks5的例子

上传者: 2021-01-01 02:55:45上传 PDF文件 38.99KB 热度 29次
网络爬虫由于一个ip频繁访问同一网站,容易返回456或者被长时间封禁。 特别的本机有socks5客户端的设置如下,前提是已经安装了socks5的客户端软件,并且启动起来在固定端口为本机提供服务。 使用前先更新requests版本为支持socks的版本。 pip install -U requests[socks] import requests my_proxies={http:http://127.0.0.1:1080,https:https://127.0.0.1:1080} resp=requests.get(http://www.some.com,proxies
下载地址
用户评论