Re: question: script to input data into a webpage and then retrievethe result?

Discussion in 'Python' started by Christoph Haas, Oct 22, 2006.

  1. On Sunday 22 October 2006 08:06, mxywp wrote:
    > Could someone help me with this or share an example script with me?
    >
    > Here is what I want to accomplish:
    > (1) input 3 values into 3 boxes on a web page
    > (2) there is an authentication code each time you access this page and I
    > have to write this code into the fourth box on the same page (3) click
    > "submit" button
    > (4) this web page will turn into a page with a table having a value
    > calculated from my inputs (5) extract this value into a local file
    > (6) repeat the above for 12000 times.
    >
    > I would really appreciate it if someone can tell me how to do it using
    > python script. I am new to python web programming.


    Dark side way:
    http://www.idyll.org/~t/www-tools/twill.html

    Christoph

    P.S.: One posting is usually sufficient to get a reply.
    Christoph Haas, Oct 22, 2006
    #1
    1. Advertising

  2. Christoph Haas

    Guest

    Re: question: script to input data into a webpage and then retrieve the result?

    Christoph Haas 写é“:

    > On Sunday 22 October 2006 08:06, mxywp wrote:
    > > Could someone help me with this or share an example script with me?
    > >
    > > Here is what I want to accomplish:
    > > (1) input 3 values into 3 boxes on a web page
    > > (2) there is an authentication code each time you access this page and I
    > > have to write this code into the fourth box on the same page (3) click
    > > "submit" button
    > > (4) this web page will turn into a page with a table having a value
    > > calculated from my inputs (5) extract this value into a local file
    > > (6) repeat the above for 12000 times.
    > >
    > > I would really appreciate it if someone can tell me how to do it using
    > > python script. I am new to python web programming.

    >
    > Dark side way:
    > http://www.idyll.org/~t/www-tools/twill.html
    >


    The main task is to constitute a correct URL.
    e.g. the requested page is www.somepage.com,
    first input form'id is input1, and respectively.

    The request URL should be
    'www.somepage.com?input1=value1&input2=value2',
    post it and you'll get the response page .

    Just do:

    import urllib

    value1=getValue1()
    ..
    ..
    ..

    url='www.somepage.com?input1='+str(value1)+'&input2='+str(value2)
    resp=urlopen(url)
    parseResp(resp)

    Problem: if the authentication code is an image, how to deal with it?

    :)Sorry for my poor english.
    , Oct 22, 2006
    #2
    1. Advertising

  3. Re: question: script to input data into a webpage and then retrieve the result?

    On 22 Oct 2006 04:21:22 -0700, ""
    <> declaimed the following in comp.lang.python:

    >
    > Problem: if the authentication code is an image, how to deal with it?
    >

    You've just discovered why so many sites are using distorted images
    of words as part of the authentication. To prevent automated bots from
    roaming -- they only want live people to access the system.
    --
    Wulfraed Dennis Lee Bieber KD6MOG

    HTTP://wlfraed.home.netcom.com/
    (Bestiaria Support Staff: )
    HTTP://www.bestiaria.com/
    Dennis Lee Bieber, Oct 22, 2006
    #3
    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. mxywp
    Replies:
    1
    Views:
    291
    Paul Rubin
    Oct 22, 2006
  2. mxywp
    Replies:
    0
    Views:
    390
    mxywp
    Oct 25, 2006
  3. Replies:
    0
    Views:
    272
  4. Michael Tan
    Replies:
    32
    Views:
    962
    Ara.T.Howard
    Jul 21, 2005
  5. Replies:
    4
    Views:
    537
    cwdjrxyz
    Jan 17, 2006
Loading...

Share This Page