I'm using the urllib2.urlopen
method to open an url and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like the know the final URL that I've been redirected to. How can i get this?
Thanks
I'm using the urllib2.urlopen
method to open an url and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like the know the final URL that I've been redirected to. How can i get this?
Thanks
The return value of urllib2.urlopen
has a geturl()
method which should return the actual (i.e. last redirect) url.