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())

报错信息如下:
图片描述

阅读 32.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题