<p>I try to fetch a Wikipedia article with Python's urllib:</p>

<pre><code>f = urllib.urlopen("http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes")           
s = f.read()
f.close()
</code></pre>

<p>However instead of the html page I get the following response: Error - Wikimedia Foundation:</p>

<pre><code>Request: GET http://en.wikipedia.org/w/index.php?title=Albert_Einstein&amp;printable=yes, from 192.35.17.11 via knsq1.knams.wikimedia.org (squid/2.6.STABLE21) to ()
Error: ERR_ACCESS_DENIED, errno [No Error] at Tue, 23 Sep 2008 09:09:08 GMT 
</code></pre>

<p>Wikipedia seems to block request which are not from a standard browser.</p>

<p>Anybody know how to work around this?</p>

Try changing the user agent header you are sending in your request to something like:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Ubuntu/8.04 (hardy) Firefox/3.0.1 (Linux Mint)