解决requests.exceptions.MissingSchema: Invalid URL ‘xxx‘: No schema supplied. Perhaps you meant“xxx”

简介: 解决requests.exceptions.MissingSchema: Invalid URL ‘xxx‘: No schema supplied. Perhaps you meant“xxx”

在使用requests请求接口的时候有时候会爆出个这样的问题,问题的大概意思是无效的url,也就是说这个url是没有效果是错误的,这就就要检查一下url是否符合规定,是否少加了协议


import requests
a=requests.get(url="www.baidu.com")   #缺少协议,这样请求会报错
print(a.json())
b=requests.get(url="http://www.baidu.com")   #加入协议后就能正确访问
print(b.json())
相关文章
|
域名解析
访问 URL 报错 500 Internal Privoxy Error
访问 URL 报错 500 Internal Privoxy Error
1479 0
|
关系型数据库
解决:Host xxx.xxx.xxx.xxx is blocked because of many connection errors.
Host “xxx.xxx.xxx.xxx” is blocked because of many connection errors 1.原因:当使用错误的密码连接mysql时,超过设定的次数 IP或主机名就会被mysqld阻塞访问。
1142 0
HttpMessageNotReadableException: Required request body is missing: xxx.controller.login(xxx)...
HttpMessageNotReadableException: Required request body is missing: xxx.controller.login(xxx)...
HttpMessageNotReadableException: Required request body is missing: xxx.controller.login(xxx)...
|
9月前
|
安全 应用服务中间件 网络安全
ebSocket connection to ‘wss://xxx.xxxxxxx.xxx/‘ failed:
ebSocket connection to ‘wss://xxx.xxxxxxx.xxx/‘ failed:
354 0
|
对象存储
上传文件到OSS报错:[Server]Unable to execute HTTP request: Position is not equal to file length
上传文件到OSS报错:[Server]Unable to execute HTTP request: Position is not equal to file length
1182 0
|
7月前
|
前端开发 安全 测试技术
【Python】已解决:The method is not allowed for the requested URL.
【Python】已解决:The method is not allowed for the requested URL.
673 3
|
5月前
|
安全 网络安全 API
7-8|requests.exceptions.SSLError: HTTPSConnectionPool(host='jumps.xxx.cn', port=443): Max ret
7-8|requests.exceptions.SSLError: HTTPSConnectionPool(host='jumps.xxx.cn', port=443): Max ret
|
9月前
|
JSON 数据格式
这个错误信息表示在执行`requests.post(url, data=data, headers=head).json()`时出现了问题
这个错误信息表示在执行`requests.post(url, data=data, headers=head).json()`时出现了问题
112 2
|
关系型数据库 Java
Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/41412595  org.
2555 0

热门文章

最新文章