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
But if you want to have the url, which is a bit more difficult, you can take a look at urllib.request.HTTPRedirectHandler