Python get generated url to string
Question: (Title might change not too sure what to call it)

So I'm trying to open a URL that directs to a random page (This URL:
[http://anidb.net/perl-
bin/animedb.pl?show=anime&do.random=1](http://anidb.net/perl-
bin/animedb.pl?show=anime&do.random=1)) and I want to return where that URL
goes

    
    
        randomURL = urllib.urlopen("http://anidb.net/perl-bin/animedb.pl?show=anime&do.random=1")
        print(randomURL)  
    

That's what I (stupidly) thought would work. I imported urllib


Answer: In Python 3 >, `urllib.urlopen` was replaced by `urllib.request.urlopen`.
Change the request line to this:

    
    
    urllib.request.urlopen('http://anidb.net/perl-bin/animedb.pl?show=anime&do.random=1')
    

For more, you can see the
[docs](http://docs.python.org/3.0/library/urllib.request.html)

But if you want to have the url, which is a bit more difficult, you can take a
look at
[`urllib.request.HTTPRedirectHandler`](http://docs.python.org/3.3/library/urllib.request.html?highlight=httpredirecthandler#urllib.request.HTTPRedirectHandler)

