Re: get wikipedia source failed (urrlib2)

2007-08-07 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > This source works fine for other site. the problem is in wikipedia. is > someone now any solution for this problem? Wikipedia, AFAIK, bans requests without a User Agent. http://www.voidspace.org.uk/python/articles/urllib2.shtml#headers -- Lawrence, oluyede.org - nero

Re: get wikipedia source failed (urrlib2)

2007-08-07 Thread shahargs
On 7 , 11:54, [EMAIL PROTECTED] wrote: > Hi, > I'm trying to get wikipedia page source with urllib2: > usock = urllib2.urlopen("http://en.wikipedia.org/wiki/ > Albert_Einstein") > data = usock.read(); > usock.close(); > return data > I got exception because HTTP 403 error. why

get wikipedia source failed (urrlib2)

2007-08-07 Thread shahargs
Hi, I'm trying to get wikipedia page source with urllib2: usock = urllib2.urlopen("http://en.wikipedia.org/wiki/ Albert_Einstein") data = usock.read(); usock.close(); return data I got exception because HTTP 403 error. why? with my browser i can't access it without any problem? Tha