问题描述
- 用Python的requests.get获取网页源代码出现ConnectionError
-
如下为具体报错:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='seth_shy', port=80): Max retries exceeded with url: http://www.jikexueyuan.com/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)))
解决方案
http://www.zhihu.com/question/40452450/answer/86705808
解决方案二:
代理连不上 或者你的目标机器访问不了
解决方案三:
用神箭手云爬虫吧,自带高匿ip代理。
时间: 2024-10-16 02:51:25