views:

93

answers:

1

I need to get the final URL after redirection in python.

What's a good way to do that?

+4  A: 
>>> import urllib2
>>> var = urllib2.urlopen('http://www.stackoverflow.com/')
>>> var.geturl()
'http://stackoverflow.com/'
Bertrand Marron
Thanks, it worked :)
Monica