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? with my

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 -

Re��: ��get wikipedia source failed�� (��urrlib2��)

2007-08-07 Thread Michael J��. ��Fromberger
In article‭ [EMAIL PROTECTED],‬ ‭ [EMAIL PROTECTED] wrote‭:‬ ‭ ‬Hi‭,‬ ‭ ‬I'm trying to get wikipedia page source with urllib2‭:‬ ‭ ‬usock‭ = ‬urllib2‭.‬urlopen‭(‬http‭://‬en.wikipedia.org/wiki‭/‬ ‭ ‬Albert_Einstein‭)‬ ‭