There is a webpage that my browser can access, but urllib2.urlopen()
(Python) and wget
both return HTTP 403 (Forbidden). Is there a way to figure out what happened?
I am using the most primitive form, like urllib2.urlopen("http://test.com/test.php")
, using the same url (http://test.com/test.php) for both the browser and wget
. I have cleared all my cookies in browser before the test.
Thanks a lot!
success bla
what system and what version of python are you running. – user1786283http://test.com/robots.txt
. Try to change User-Agent header. – jfshttp://test.com/test.php
literally. – Nathan