Like we open a URL to a normal browser so it will redirect to another website url. Example a shorted link. After you open this it will redirect you to the main url.
So how to do this in python I mean I need to open a URL on python and this will redirect to other website page then I will copy the other website page link.
That's all I want to know thank you.
I tried it with python requests and urllib module.
Like this
import requests
a = requests.get("url", allow_redirects = True)
And
import urllib.request
a = urllib.request.urlopen("url")
But it's not working at all. I mean didn't get the redirected page.
<meta refresh="time;url">(3) JavaScript can setdocument.location = url(or similar).Requestsautomatically redirect for first type. For second type It is easy to check if HTML has meta tag and run next request with new url. But third type makes problem because requests can't run JavaScript and there are many different method to assign new location.