在用Python进行图片抓取时,request出现以下的错误信息

朱季谦 发布于 2018/06/06 11:41
阅读 359
收藏 2

在进行Python网页图片抓取时,出现以下错误信息,烦请各位大佬指教一下这个错误如何解决:

 

Traceback (most recent call last):
  File "D:\JAVA\workspace\pachong\pachong\__init__.py", line 29, in <module>
    newr = requests.get(newurl)
  File "D:\Python\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "D:\Python\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "D:\Python\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\Python\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "D:\Python\lib\site-packages\requests-2.18.4-py2.7.egg\requests\adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='desk.zol.com.cnhttp', port=80): Max retries exceeded with url: //xiazai.zol.com.cn/detail/45/443017.shtml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000000002F0AE48>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))

 

加载中
0
s
samwon

requests.exceptions.ConnectionError: HTTPConnectionPool(host='desk.zol.com.cnhttp', port=80):

host怎么成了desk.zol.com.cnhttp了?看看是不是URL拼接的有问题。

返回顶部
顶部