Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

爬虫错误 #1

Open
stavewang opened this issue Nov 18, 2020 · 1 comment
Open

爬虫错误 #1

stavewang opened this issue Nov 18, 2020 · 1 comment

Comments

@stavewang
Copy link

请问,您在使用该爬虫程序的时候是否遇到过如下错误,是否可以指出修改建议?:
runfile('C:/Users/QuincyCho/Desktop/数据/pems_crawler.py', wdir='C:/Users/QuincyCho/Desktop/数据')
try to login
Traceback (most recent call last):

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)

TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connectionpool.py", line 677, in urlopen
chunked=chunked,

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)

File "C:\Users\QuincyCho\anaconda3\envs\stave\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)

File "C:\Users\QuincyCho\anaconda3\envs\stave\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)

File "C:\Users\QuincyCho\anaconda3\envs\stave\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)

File "C:\Users\QuincyCho\anaconda3\envs\stave\lib\http\client.py", line 1016, in _send_output
self.send(msg)

File "C:\Users\QuincyCho\anaconda3\envs\stave\lib\http\client.py", line 956, in send
self.connect()

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connection.py", line 187, in connect
conn = self._new_conn()

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connection.py", line 172, in _new_conn
self, "Failed to establish a new connection: %s" % e

NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002A2087B54A8>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\requests\adapters.py", line 449, in send
timeout=timeout

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\urllib3\util\retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))

MaxRetryError: HTTPConnectionPool(host='pems.dot.ca.gov', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002A2087B54A8>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\QuincyCho\Desktop\数据\pems_crawler.py", line 193, in
a.login()

File "C:\Users\QuincyCho\Desktop\数据\pems_crawler.py", line 53, in login
self.post(self.home, data)

File "C:\Users\QuincyCho\Desktop\数据\pems_crawler.py", line 42, in post
return self.s.post(url, data = data, headers = headers)

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\requests\sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)

File "C:\Users\QuincyCho\AppData\Roaming\Python\Python37\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)

ConnectionError: HTTPConnectionPool(host='pems.dot.ca.gov', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000002A2087B54A8>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))

@PlanckChang
Copy link

已经不给爬了,散了吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants