首页上一页 1 下一页尾页 1 条记录 1/1页
代码,没错,为何爬虫无法实现,求助
发表在Python图书答疑
2023-09-24
《Python网络爬虫从入门到实践》第11章 多线程与多进程爬虫 180页-185页
是否精华
是
否
版块置顶:
是
否
Traceback (most recent call last): File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 714, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 466, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 461, in _make_request httplib_response = conn.getresponse() ^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\http\client.py", line 1378, in getresponse response.begin() File "C:\ProgramData\anaconda3\Lib\http\client.py", line 318, in begin version, status, reason = self._read_status() ^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\http\client.py", line 279, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\socket.py", line 706, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\ProgramData\anaconda3\Lib\site-packages\requests\adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 798, in urlopen retries = retries.increment( ^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\util\retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\packages\six.py", line 769, in reraise raise value.with_traceback(tb) File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 714, in urlopen httplib_response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 466, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "C:\ProgramData\anaconda3\Lib\site-packages\urllib3\connectionpool.py", line 461, in _make_request httplib_response = conn.getresponse() ^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\http\client.py", line 1378, in getresponse response.begin() File "C:\ProgramData\anaconda3\Lib\http\client.py", line 318, in begin version, status, reason = self._read_status() ^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\http\client.py", line 279, in _read_status line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\socket.py", line 706, in readinto return self._sock.recv_into(b) ^^^^^^^^^^^^^^^^^^^^^^^ urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\郑洪\Desktop\pachong\11\12\pool_spider.py", line 72, in <module> s.get_info(i) # 发送网络请求,获取每个电影详情信息 ^^^^^^^^^^^^^ File "C:\Users\郑洪\Desktop\pachong\11\12\pool_spider.py", line 28, in get_info info_response = requests.get(url,header) # 发送获取每条电影信息的网络请求 ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ProgramData\anaconda3\Lib\site-packages\requests\adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))