【发布时间】:2020-09-07 03:37:37
【问题描述】:
我正在尝试使用我在 python 中使用 pip 安装的 wikipidia 包从 wikipidia 获取数据。但是当我运行此代码时,它会出现此错误:
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('No status line received - the server has closed the connection',))
这是我的代码:
import wikipedia
print(wikipedia.summary('albert einstien',sentences= 3))
我尝试将 wikipedia.API_URL 设置为 https 而不是 http。我的代码在 repl.it(在线编码平台)上运行良好,但是当我在我的电脑上运行时出现此错误
【问题讨论】:
-
使用“阿尔伯特·爱因斯坦”有什么不同吗?
标签: python https python-requests connection wikipedia