Home > Blockchain >  Python: request.get for github doesn't work
Python: request.get for github doesn't work

Time:11-10

I am trying to run a GET request for a Github url. Unfortunately, I always get an error message.

I tried it for several different websites and it works, just not for github.

I am trying to do it with Jupyter Notebooks in Python, if that is important.

Here is the Error message:

ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /jana-hoh/gdp/main/DP_LIVE_22102021141534889.csv (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f7a1c285d60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

CodePudding user response:

An error message that includes Temporary failure in name resolution indicates that the system's DNS server is unable to convert domain names into their corresponding IP address. Some of the causes are:

  • Your DNS configuration is correct, but the server is unable to respond to DNS requests at the moment
  • Firewall rules
  • No internet connectivity

Most of the times I've encountered this error stemmed from being disconnected to the internet. However, if your internet is working properly, you can try to add another DNS server in /etc/resolv.conf. For example, you can add cloudflare's:

nameserver 1.1.1.1
  • Related