News-retrieval client-news.google

G

Guest

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:[email protected]
Skype:brandon.mcginty
Msn:[email protected]
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
 
M

Matt H

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top