Errno 11001 getaddrinfo失败

时间:2019-12-02 13:39:23

标签: python api

我有一个教程中的简单代码

import requests

request = requests.get('https://api.github.com')
print(request.status_code)

尝试运行它会导致此错误

ConnectionError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 
x000001E7939BE408>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))

没有太多代码,所以与该教程相比,我真的不知道我做错了什么。

0 个答案:

没有答案