Closed getr00t closed 2 years ago
必须要Python2.7吗用2.7.15可以不?
可以,直接运行就好,可以看下写的注释
需要自己来根据实际情况修改配置吗?我是直接安装的库后就直接运行了,回显了一堆错误
Exception in thread Thread-4: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285602 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BB70>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-6: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285604 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44128>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-10: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285608 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44668>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-5: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285603 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2B5C0>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-3: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285601 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BE48>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285599 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2B978>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-7: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285605 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44470>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-9: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285607 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D445F8>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-2: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285600 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BC88>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-8: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285606 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D444E0>: Failed to establi sh a new connection: [Errno 10060] ',))
test2.py直接执行后的回显
Exception in thread Thread-4: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285602 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BB70>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-6: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285604 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44128>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-10: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285608 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44668>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-5: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285603 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2B5C0>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-3: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285601 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BE48>: Failed to establi sh a new connection: [Errno 10060] ',)) Exception in thread Thread-1: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285599 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2B978>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-7: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285605 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D44470>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-9: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285607 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D445F8>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-2: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285600 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D2BC88>: Failed to establi sh a new connection: [Errno 10060] ',))
Exception in thread Thread-8: Traceback (most recent call last): File "D:\Python27\lib\threading.py", line 801, in __bootstrap_inner self.run() File "test2.py", line 20, in run self.spider(url=page_url) File "test2.py", line 25, in spider r = requests.get(url=url, headers=headers) File "D:\Python27\lib\site-packages\requests\api.py", line 75, in get return request('get', url, params=params, kwargs) File "D:\Python27\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 533, in reques t resp = self.send(prep, send_kwargs) File "D:\Python27\lib\site-packages\requests\sessions.py", line 646, in send r = adapter.send(request, kwargs) File "D:\Python27\lib\site-packages\requests\adapters.py", line 516, in send raise ConnectionError(e, request=request) ConnectionError: HTTPConnectionPool(host='g.91p35.space', port=80): Max retries exceeded with url: /viewthread.php?tid=285606 (Caused by NewConnectionError('<ur llib3.connection.HTTPConnection object at 0x0000000002D444E0>: Failed to establi sh a new connection: [Errno 10060] ',))
test2.py直接执行后的回显
这个错误是http请求失败,没法建立链接,现在网址最好开个代理上。
后面我更新一个错误解释的版本吧:)
表示代理开了一样的,具体怎么使用有教程和视频吗
具体怎么使用尼