爬虫报错requests.exceptions.ProxyError:/Failed to establish a new connection: [WinError 10061]
本人导致报错的可能原因:
下载vpn软件所导致(可能性较小)
使用ip代理不当导致
报错:
requests.exceptions.ProxyError: HTTPSConnectionPool(host='www.baidu.com', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001F214A7AEC8>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')))
先上解决方案:
方案一
如果你使用的是requests库的话就添加这几行
import requests
session = requests.Session()
session.trust_env = False
url = 'https://www.baidu.com'
session.get(url)
如果你使用的是request_html库的话,就这样写
from requests_html import HTMLSession
session = HTMLSession()
session.trust_env = False
session.get(url)
session.trust_env = False 使用绕过系统代理
方案二
可以尝试换网,例如你现在是宽带就换wifi试一下或者是手机热点,本人就是宽带报错,但是换网之后就不报错
如果有更好的解决方案或者知道报错的根本原因是什么的话,请留言讨论
爬虫报错requests.exceptions.ProxyError:/Failed to establish a new connection: [WinError 10061]相关推荐
- [环境配置]Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。‘)))”代理解决办法
pip安装提示错误: "(Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.c ...
- Conda更新报错:requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mirrors.tuna.t
Conda更新报错:requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://mirrors.tuna.t ...
- Postgres数据库报错:FATAL: Peer authentication failed for user “zabbix“ Previous connection kept
报错信息 :FATAL: Peer authentication failed for user "zabbix" /etc/postgresql/9.3/main/pg_hba. ...
- postgres报错:FATAL: Peer authentication failed for user “zabbix“ Previous connection kept
连接zabbix用户失败, postgres=# \c - zabbix FATAL: Peer authentication failed for user "zabbix" P ...
- Python代理IP异常:requests.exceptions.ProxyError: HTTPSConnectionPool(host=‘xxxx‘, port=443)
背景 这是我在使用Python爬取网页信息的时候出现的异常. 由于很多要爬取的网站会把"IP限制"作为反爬虫手段,所以我偶尔会使用"代理IP服务器"去处理相关需 ...
- 已解决(Python爬虫requests报错)requests.exceptions.ProxyError: HTTPSConnectionPool
成功解决(Python爬虫requests报错):requests.exceptions.ProxyError: HTTPSConnectionPool 文章目录 报错信息 报错翻译 报错原因 解决方 ...
- 安装TensorRT,然后导入uff库包的时候报错:ImportError: ERROR: Failed to import module(cannot import name ‘GraphDef`)
欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 安装TensorRT,然后导入uff库包的时候报错:ImportError: ERROR: Failed to impo ...
- httpd启动报错:httpd: apr_sockaddr_info_get() failed for jsp...
httpd启动报错:httpd: apr_sockaddr_info_get() failed for jsp... 今天在搭建Apache+tomcat整合环境的时候,遇到httpd启动报错这种情况 ...
- 报错信息为:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
报错信息为:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource ...
最新文章
- 22年前被嘲养猪的北大学子,如今带领200多户住上别墅,90后研究生也跟他加入养猪行列...
- [YTU]_2625( 构造函数和析构函数)
- 在Oracle中如何让SELECT查询绕过UNDO
- python里面返回上一步_Python中的这3个骚操作你会吗?
- wxWidgets:wxDialog类用法
- 喜提 Go Contributor
- 【渝粤教育】电大中专电子商务网站建设与维护 (14)作业 题库
- ReportViewer教程(15)-矩阵报表-1
- [原创]个人工具 - 对APK极限压缩并对齐的工具(58.ReExtremeZipAndAlignAPK)
- Linux简单死锁程序,Linux 死锁例子
- 3Sum Closest
- 设置电脑的双显示器模式
- 图片底色去除vue+canvas(简易版)
- 在Elasticsearch中回测隨機(Stochastic)指標交叉交易策略
- 【软件技巧】Transmission跳过检验(跳检)方法,适用于全平台
- druid数据源下 sqlserver 出现 对象名 'xxx' 无效
- PortSwigger Academy | Authentication : 身份认证
- 【Nexus】Nexus简介与安装
- bummed out
- StringRedisTemplate报NullPointerException