关于网友提出的“ python3 错误“No connection adapters were found for””问题疑问,本网通过在网上对“ python3 错误“No connection adapters were found for””有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: python3 错误“No connection adapters were found for”
描述:python3 版本
检查连接的时候,出现错误“requests.exceptions.InvalidSchema: No connection adapters were found for '?http://oil.cngold.com.cn/2016...'”实在是不知道啥原因?很是奇怪
代码如下:
import requests
from bs4 import BeautifulSoup
filepath = 'E:/links.txt'
with open(filepath,'rb') as f:
links = f.readlines()
for link in links:
link = link.strip().decode()
print(link)
html = requests.get(link)
soup = BeautifulSoup(html.text)
print(soup.title.get_text())
报错信息如下:

解决方案1:
这可以运行啊,
这类问题参考
Requests : No connection adapters were found for, error in Python3
以上介绍了“ python3 错误“No connection adapters were found for””的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/4066381.html