News-retrieval client-news.google

Discussion in 'Python' started by Guest, Apr 14, 2006.

  1. Guest

    Guest 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:
    Skype:brandon.mcginty
    Msn:
    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
    Guest, Apr 14, 2006
    #1
    1. Advertising

  2. Guest

    Matt H Guest

    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.
    Matt H, Apr 14, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Sew
    Replies:
    2
    Views:
    483
    bruce barker
    Feb 12, 2004
  2. =?Utf-8?B?U3dheQ==?=

    Form information retrieval

    =?Utf-8?B?U3dheQ==?=, Apr 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    340
    Pete Beech
    Apr 18, 2004
  3. Rick Spiewak

    Re: HTML Form value retrieval

    Rick Spiewak, May 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    =?Utf-8?B?TWF0dA==?=
    May 7, 2004
  4. Replies:
    1
    Views:
    370
    Grant Merwitz
    Sep 19, 2005
  5. thoward
    Replies:
    3
    Views:
    347
    thoward
    Sep 4, 2007
Loading...

Share This Page