Redirect error when trying to request a url with requests/urllib only in python
Since you are using the requests
module did you try to tell the requests module to ignore redirects?
import requestsresponse = requests.get('your_url_here', allow_redirects=False)
Maybe this work.If this doesn't work, you can also try to change your user-agent
in case your server is configured to drop script-requests
for security reasons.
import requestsheaders = {'user-agent': 'some_user_agent'}response = requests.get(url, headers=headers)