|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
大家新年快乐
定制opener后,用代理访问却出现错误如下:
- Traceback (most recent call last):
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1254, in do_open
- h.request(req.get_method(), req.selector, req.data, headers)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1106, in request
- self._send_request(method, url, body, headers)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1151, in _send_request
- self.endheaders(body)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1102, in endheaders
- self._send_output(message_body)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 934, in _send_output
- self.send(msg)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 877, in send
- self.connect()
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 849, in connect
- (self.host,self.port), self.timeout, self.source_address)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 711, in create_connection
- raise err
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 702, in create_connection
- sock.connect(sa)
- TimeoutError: [Errno 60] Operation timed out
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "/Users/Xric0i/Documents/proxyy.py", line 6, in <module>
- reponse = urllib.request.urlopen(url)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 163, in urlopen
- return opener.open(url, data, timeout)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 466, in open
- response = self._open(req, data)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 484, in _open
- '_open', req)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 444, in _call_chain
- result = func(*args)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1282, in http_open
- return self.do_open(http.client.HTTPConnection, req)
- File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1256, in do_open
- raise URLError(err)
- urllib.error.URLError: <urlopen error [Errno 60] Operation timed out>
复制代码
求助各位。 |
|