Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > News-retrieval client-news.google

Reply
Thread Tools

News-retrieval client-news.google

 
 
Guest
Posts: n/a
 
      04-14-2006
Hi All,
I'm trying to write a news retrieval client in python.
I'm going to get the news from google's news service.
However, when I run the following code, google gives me a 403 error.
Is it google, or urllib2? Or is it the code?
I can parse the 'contents' variable, I just need to know what is going
wrong.

THX,
Brandon


#startofcode
import urllib2,htmldata
url='http://news.google.com/news'#?ned=tus&rec=0'
contents = urllib2.urlopen(url).read()
Print contents
#endofcode



----------
Feel free to contact me for technical support, or just to chat; I always
have time to talk and help, and an open ear.
Email:(E-Mail Removed)
Skype:brandon.mcginty
Msn:(E-Mail Removed)
Aim:brandonmcginty (Not currently available.)
Cell:4802025790 (Weekends and nights only, please.)
"Kindness is a language that the deaf can hear and the blind can see."
Mark Twain

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.4.1/312 - Release Date: 4/14/2006


 
Reply With Quote
 
 
 
 
Matt H
Guest
Posts: n/a
 
      04-14-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hi All,
> I'm trying to write a news retrieval client in python.
> I'm going to get the news from google's news service.
> However, when I run the following code, google gives me a 403 error.


Knowing google, they're blocking the user agent supplied by urllib2.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments