I am writing a function that downloads and stores the today\'s list of pre-release domains .txt file from http://www.namejet.com/pages/downloads.aspx. I am trying to achieve it
I see a few problems with your approach:
The page doesn't return any json; so even if you were to access the page successfully, r.json
will be empty:
>>> import requests
>>> r = requests.get('http://www.namejet.com/pages/downloads.aspx')
>>> r.json
The file that you are after, is hidden behind a postback link; which you cannot "execute" using requests as it will not understand javascript.
In light of the above, the better approach is to use mechanize or alternatives to emulate a browser. You could also ask the company to provide you with a direct link.