好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 joy95611 于 2023-9-18 14:01 编辑
没有跑通,网络问题?
python ./goldprice.py
Traceback (most recent call last):
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/util/connection.py", line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/home/xkada284/anaconda3/lib/python3.6/socket.py", line 745, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/home/xkada284/anaconda3/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/xkada284/anaconda3/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/xkada284/anaconda3/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/xkada284/anaconda3/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/home/xkada284/anaconda3/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0993028ef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='hq.sinajs.cn', port=80): Max retries exceeded with url: /list=gds_AUTD (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0993028ef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./goldprice.py", line 31, in <module>
r=requests.get(url+id,headers=headers)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/home/xkada284/anaconda3/lib/python3.6/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='hq.sinajs.cn', port=80): Max retries exceeded with url: /list=gds_AUTD (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0993028ef0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) |
|