Can not get urllib.urlopen to work

Andrew Dalke adalke at
Wed Oct 27 22:09:28 CEST 2004

Pater Maximus wrote:

> I am trying to implement the recipe listed at
> However, I can not get to first base. When I try to run
> import urllib
> fo=urllib.urlopen("")
> page =

I can't even connect to it with my web browser.  Can you?
If you can, they are probably checking the user-agent sent
by urllib, to make it harder to do this sort of automated
screen scraping.

See the docs at

for an example of how to change the default user-agent.

Here's one for MSIE under Win2K

   Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

				dalke at

More information about the Python-list mailing list