MyU*_*ser 1 python python-3.x python-requests python-3.4
当我在Windows8.1上的Python3.4中运行以下代码时:
r = requests.get(url)
Run Code Online (Sandbox Code Playgroud)
除其他外,它还返回:
File "C:\Python34\lib\site-packages\requests\sessions.py", line 644, in get_adapter
raise InvalidSchema("No connection adapters were found for '%s'" % url) requests.exceptions.InvalidSchema: No connection adapters were found for '"http://example.com"'
Run Code Online (Sandbox Code Playgroud)
这仅仅是我的代码、防火墙或其他问题的问题吗?我该如何修复它?
更改您的获取请求以仅使用一种类型的引号:
requests.get("http://example.com")
Run Code Online (Sandbox Code Playgroud)
您尝试同时使用两种类型的引号来执行此操作,并且它会给出正确的错误:
requests.get('"http://example.com"')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8963 次 |
| 最近记录: |