Answer the question
In order to leave comments, you need to log in
How to see all redirects of a request?
I make a request and try to see the redirect history.
response = requests.get(url=...)
print(response.history)
Answer the question
In order to leave comments, you need to log in
Only redirects through HTTP 3XX response codes get there.
Javascript redirects or the meta-refresh tag will work in the browser, but requests doesn't process them and therefore doesn't know anything about them.
Another possible mechanism is a DNS CNAME record for the requested domain name. I'm not sure about its implementability and interaction with requests, but I doubt it will be noticed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question