request python disable proxy_python requests爬虫报错requests.exceptions.ProxyError: HTTPSConnectionPool...

[Asm] 纯文本查看 复制代码Traceback (most recent call last):

File "C:\Program Files\Python37\lib\site-packages\urllib3\connection.py", line 159, in _new_conn

(self._dns_host, self.port), self.timeout, **extra_kw)

File "C:\Program Files\Python37\lib\site-packages\urllib3\util\connection.py", line 80, in create_connection

raise err

File "C:\Program Files\Python37\lib\site-packages\urllib3\util\connection.py", line 70, in create_connection

sock.connect(sa)

TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Program Files\Python37\lib\site-packages\urllib3\connectionpool.py", line 594, in urlopen

self._prepare_proxy(conn)

File "C:\Program Files\Python37\lib\site-packages\urllib3\connectionpool.py", line 805, in _prepare_proxy

conn.connect()

File "C:\Program Files\Python37\lib\site-packages\urllib3\connection.py", line 301, in connect

conn = self._new_conn()

File "C:\Program Files\Python37\lib\site-packages\urllib3\connection.py", line 168, in _new_conn

self, "Failed to establish a new connection: %s" % e)

urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Program Files\Python37\lib\site-packages\requests\adapters.py", line 449, in send

timeout=timeout

File "C:\Program Files\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen

_stacktrace=sys.exc_info()[2])

File "C:\Program Files\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment

raise MaxRetryError(_pool, url, error or ResponseError(cause))

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pan.baidu.com', port=443): Max retries exceeded with url: /s/1c0Ei5K (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

r = requests.get('https://pan.baidu.com/s/1c0Ei5K#list/path=%2F', headers=headers)

File "C:\Program Files\Python37\lib\site-packages\requests\api.py", line 75, in get

return request('get', url, params=params, **kwargs)

File "C:\Program Files\Python37\lib\site-packages\requests\api.py", line 60, in request

return session.request(method=method, url=url, **kwargs)

File "C:\Program Files\Python37\lib\site-packages\requests\sessions.py", line 533, in request

resp = self.send(prep, **send_kwargs)

File "C:\Program Files\Python37\lib\site-packages\requests\sessions.py", line 646, in send

r = adapter.send(request, **kwargs)

File "C:\Program Files\Python37\lib\site-packages\requests\adapters.py", line 510, in send

raise ProxyError(e, request=request)

requests.exceptions.ProxyError: HTTPSConnectionPool(host='pan.baidu.com', port=443): Max retries exceeded with url: /s/1c0Ei5K (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。')))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值