标签:rac ack python ret LIDS name 开始学习 import ssi
刚开始学习,使用requests时,敲了点demo
1 import requests 2 3 params = { 4 "name": "name", 5 "password": "高宇博" 6 } 7 8 res = requests.get("127.0.0.1:8000", params=params)
结果出现错误
C:\Users\gaoyu\Envs\py_path1\Scripts\python.exe D:/python3.6/spider/demo/requests_test.py Traceback (most recent call last): File "D:/python3.6/spider/demo/requests_test.py", line 8, in <module> res = requests.get("127.0.0.1:8000", params=params) File "C:\Users\gaoyu\Envs\py_path1\lib\site-packages\requests\api.py", line 75, in get return request(‘get‘, url, params=params, **kwargs) File "C:\Users\gaoyu\Envs\py_path1\lib\site-packages\requests\api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "C:\Users\gaoyu\Envs\py_path1\lib\site-packages\requests\sessions.py", line 533, in request resp = self.send(prep, **send_kwargs) File "C:\Users\gaoyu\Envs\py_path1\lib\site-packages\requests\sessions.py", line 640, in send adapter = self.get_adapter(url=request.url) File "C:\Users\gaoyu\Envs\py_path1\lib\site-packages\requests\sessions.py", line 731, in get_adapter raise InvalidSchema("No connection adapters were found for ‘%s‘" % url) requests.exceptions.InvalidSchema: No connection adapters were found for ‘127.0.0.1:8000‘
最后发现原因很简单,就是因为url前面需要加http://
报错requests.exceptions.InvalidSchema: No connection adapters were found for
标签:rac ack python ret LIDS name 开始学习 import ssi
原文地址:https://www.cnblogs.com/gaoyubo/p/12128668.html