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