is this possible (getting info off web page)

Discussion in 'Python' started by Esmail, Apr 9, 2009.

  1. Esmail

    Esmail Guest

    Hi,

    I am trying to keep track of two flight bookings on the kayak.com
    web site, and would like to automate my query using Python. If I
    enter the url below myself into the browser, a form gets filled
    out and the site searches for flights. I would love to be able to
    have a simple python script which I can supply with a url and
    have it simply display, in text if possible, the best 3 prices.

    I thought great opportunity to learn more about Python, and then
    presumably re as I parse the text....

    However, when I use the code below (located via google), I end up
    with an alternate page, basically telling me that kayak doesn't like
    bots. So, it seems like Kayak has it set up to prevent automated
    access?

    Is there anyway to do what I would like to do?

    Thanks,

    Esmail

    --

    import urllib2

    url = 'http://www.kayak.com/s/search/air?l1=cmh&d1=4/23/2009&l2=yyz&d2=4/26/2009'
    res = urllib2.urlopen(url)
    page = res.read()
     
    Esmail, Apr 9, 2009
    #1
    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. Steve
    Replies:
    0
    Views:
    458
    Steve
    Jan 31, 2006
  2. Wayne...
    Replies:
    15
    Views:
    771
    Toby Inkster
    Jul 23, 2004
  3. robert112
    Replies:
    1
    Views:
    443
    Juan T. Llibre
    Apr 26, 2007
  4. S_K
    Replies:
    1
    Views:
    393
    IfThenElse
    Oct 2, 2007
  5. Ricardo Garcia

    getting info on another web page

    Ricardo Garcia, Sep 5, 2004, in forum: Javascript
    Replies:
    2
    Views:
    89
Loading...

Share This Page