Arjun Paudyal

Learn more with Zeal

Requests Get list of Redirections
                
            
                import requests #thank you Kenneth
                # or from requests import get
                # get..
                
                url = 'http://www.gmail.com'
                r = requests.get(url, allow_redidrects=True)
                print(r.history)
                # prints list
                # [<Response [301]>, <Response [302]>, <Response [302]>]
                
                for rsp in r.history:
                print(rsp.url)
                
                http://www.gmail.com/
                https://www.google.com/gmail/
                https://mail.google.com/mail/
                
                
            

Design || Disclaimer
This site is currently under development