Guide
error
when r = requests.get(url)
, error occur:
requests.exceptions.ProxyError: HTTPConnectionPool(host=’127.0.0.1’, port=8888):
Max retries exceeded with url: http://www.baidu.com/ (Caused by ProxyError(‘Cannot
connect to proxy.’, NewConnectionError(‘<urllib3.connection.HTTPConnection object
at 0x7f5611990080>: Failed to establish a new connection: [Errno 111] Connection
refused’)))
solutions
1 | $ env | grep -i proxy |
edit ~/.bashrc
1 | export http_proxy='' |
and run source ~.bashrc
Now OK.
or by code
1 | proxies = { "http": None, "https": None} |
Reference
History
- 2019/11/08: created.