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')))
这个问题只发生在我的电脑上。 此代码在另一台计算机上运行良好。 我试图重置计算机网络设置,但运气不好。 谢谢
这可能是由于您的计算机上的安全首选项造成的,如果您在公共网络上,这是显而易见的,但我建议您只需将所有链接转换为HTTPS链接
而且它更安全
相关问题 更多 >
编程相关推荐