At the beginning of learning, when using requests, I knocked on demo
1 import requests
2
3 params = {
4 "name": "name",
5 "password": "gao"
6 }
7
8 res = requests.get("127.0.0.1:8000", params=params)
There was an error in the result
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'
Finally, it is found that the reason is very simple, that is, the URL needs to be preceded by http://
Similar Posts:
- Python 2.7 and 3.4 requests Error: No module named ‘zlib’
- Using Python HDFS module to operate Hadoop HDFS
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘M…
- Error report of cell timed task startup: KeyError: ‘scheduler’ KeyError: ‘entries’
- [Solved] torch.cuda.CudaError: CUDA driver version is insufficient for CUDA runtime version (35) [ WARN:0
- [Solved] Pytoch nn.CrossEntropyLoss Error: RuntimeError: expected scalar type Long but found Float
- [Solved] UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa5 in position 1508: illegal multibyte sequence
- [Solved] Exception: Jupyter command `jupyter-notbook` not found.
- MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors
- Python AttributeError: ‘unicode’ object has no attribute ‘tzinfo’