无法从python请求访问任何http url

2024-10-05 12:21:46 发布

您现在位置:Python中文网/ 问答频道 /正文

python请求库有问题。 我无法获取任何以HTTP开头的URL。https工作正常。 这是我的代码:(python3.7)

import requests
r = requests.get("http://habitat.habhub.org/habitat/")
print(r.content)

我得到一个代理(?)错误? 我没有任何代理设置

requests.exceptions.ProxyError: HTTPSConnectionPool(host='192.168.31.66', port=8888): Max retries exceeded with url: http://habitat.habhub.org/habitat/ (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x04098230>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond')))

这个问题只发生在我的电脑上。 此代码在另一台计算机上运行良好。 我试图重置计算机网络设置,但运气不好。 谢谢


Tags: to代码orghttphost代理connectionrequests

热门问题