Reputation: 43
I need to get the final URL after redirection in python.
What's a good way to do that?
Upvotes: 4
Views: 2542
Reputation: 22210
>>> import urllib2
>>> var = urllib2.urlopen('http://www.stackoverflow.com/')
>>> var.geturl()
'http://stackoverflow.com/'
Upvotes: 8