python shell运行正常
import requests
r = requests.get('
https://www.google.com')
r.content
存为文件python google.py运行报错
r = requests.get('
https://www.google.com')
File "/usr/local/lib/python2.7/site-packages/requests/
api.py", line 60, in get
return request('get', url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/
api.py", line 49, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/
sessions.py", line 457, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/
sessions.py", line 569, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/
adapters.py", line 362, in send
timeout=timeout
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/
connectionpool.py", line 516, in urlopen
body=body, headers=headers)
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/
connectionpool.py", line 304, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/
connectionpool.py", line 722, in _validate_conn
conn.connect()
File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/
connection.py", line 169, in connect
self.sock = ssl.wrap_socket(conn, self.key_file, self.cert_file)
AttributeError: 'NoneType' object has no attribute 'wrap_socket'
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/185948
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.