Python urllib.urlopen() call doesn't work with a URL that a browser accepts

Posted by Charles Anderson on Stack Overflow See other posts from Stack Overflow or by Charles Anderson
Published on 2009-08-26T15:09:57Z Indexed on 2010/05/20 8:40 UTC
Read the original article Hit count: 260

Filed under:
|
|

If I point Firefox at http://bitbucket.org/tortoisehg/stable/wiki/Home/ReleaseNotes, I get a page of HTML. But if I try this in Python:

import urllib

site = 'http://bitbucket.org/tortoisehg/stable/wiki/Home/ReleaseNotes'
req = urllib.urlopen(site)
text = req.read()

I get the following:

500 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about python

Related posts about urllib