Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

Discussion in 'Python' started by neil.fitzgerald@ic.ac.uk, Apr 13, 2006.

  1. Guest

    Hi all,

    I'm using pywin to write a script that will commandeer internet
    explorer to go to a certain website, where it will navigate menus, post
    forms, and eventually retrieve certain data.

    Here's my question: Suppose a form has more than one submit button.
    Now the COM 'form' object has a 'submit' method that doesn't take any
    arguments, so how do I tell it which button I want to press?

    I'll be *unbelievably* grateful, for the rest of my natural life, to
    whomever has the answer to this.

    (Yeah, I realize it's more of a COM question than a Python question.
    If you know of a more suitable group, or a website where such questions
    are dealth with then by all means redirect me. I'll be exceedingly
    grateful, though perhaps not for the rest of my natural life.)

    Neil
    , Apr 13, 2006
    #1
    1. Advertising

  2. Paul McGuire Guest

    <> wrote in message
    news:...
    > Hi all,
    >
    > I'm using pywin to write a script that will commandeer internet
    > explorer to go to a certain website, where it will navigate menus, post
    > forms, and eventually retrieve certain data.
    >
    > Here's my question: Suppose a form has more than one submit button.
    > Now the COM 'form' object has a 'submit' method that doesn't take any
    > arguments, so how do I tell it which button I want to press?
    >
    > I'll be *unbelievably* grateful, for the rest of my natural life, to
    > whomever has the answer to this.
    >
    > (Yeah, I realize it's more of a COM question than a Python question.
    > If you know of a more suitable group, or a website where such questions
    > are dealth with then by all means redirect me. I'll be exceedingly
    > grateful, though perhaps not for the rest of my natural life.)
    >
    > Neil
    >


    Perhaps instead of trying to contort IE to y
    Paul McGuire, Apr 13, 2006
    #2
    1. Advertising

  3. Paul McGuire Guest

    <> wrote in message
    news:...
    > Hi all,
    >
    > I'm using pywin to write a script that will commandeer internet
    > explorer to go to a certain website, where it will navigate menus, post
    > forms, and eventually retrieve certain data.
    >
    > Here's my question: Suppose a form has more than one submit button.
    > Now the COM 'form' object has a 'submit' method that doesn't take any
    > arguments, so how do I tell it which button I want to press?
    >
    > I'll be *unbelievably* grateful, for the rest of my natural life, to
    > whomever has the answer to this.
    >
    > (Yeah, I realize it's more of a COM question than a Python question.
    > If you know of a more suitable group, or a website where such questions
    > are dealth with then by all means redirect me. I'll be exceedingly
    > grateful, though perhaps not for the rest of my natural life.)
    >
    > Neil
    >


    Perhaps instead of trying to contort IE to your will, you might take a look
    at twill. I think it will do what you need in a much less roundabout way.

    -- Paul
    Paul McGuire, Apr 13, 2006
    #3
  4. Paul Rubin Guest

    writes:
    > Here's my question: Suppose a form has more than one submit button.
    > Now the COM 'form' object has a 'submit' method that doesn't take any
    > arguments, so how do I tell it which button I want to press?


    What difference does it make? Don't they all do the same thing?
    Paul Rubin, Apr 14, 2006
    #4
  5. Guest

    Paul Rubin wrote:
    > writes:
    > > Here's my question: Suppose a form has more than one submit button.
    > > Now the COM 'form' object has a 'submit' method that doesn't take any
    > > arguments, so how do I tell it which button I want to press?

    >
    > What difference does it make? Don't they all do the same thing?


    Not in this case, no.

    If you want to see an example of how the button you press might make a
    difference, go to www.google.com.

    What I'm dealing with, basically, is a form consisting of lots of
    <INPUT type="image" name=whatever, value=whatever... > tags, which is
    being used purely as a collection of links. However, this arrangement
    means that they don't appear as links in the document object's "links"
    collection.

    Now in the case of Google, the form contains a pair of 'items'
    corresponding to the two buttons, and each item has a click method, and
    so everything works out fine. However, in the page I'm trying to
    navigate, the form doesn't possess any 'items' whatsoever.

    Anyway, it's seeming more and more likely to me that the page was
    specifically designed to prevent anyone doing what I'm trying to do
    (which is not in any way nefarious, but if I succeeded then it would
    only take a small modification to make it very destructive indeed.)
    Hence, I'm giving up.

    Sorry for the waste of bandwidth.
    , Apr 14, 2006
    #5
    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. Matt
    Replies:
    0
    Views:
    685
  2. Matt
    Replies:
    2
    Views:
    161
    Bob Barrows [MVP]
    Jun 27, 2004
  3. sandyde2
    Replies:
    2
    Views:
    180
    sandyde2
    Oct 2, 2003
  4. Matt
    Replies:
    1
    Views:
    205
    Thomas 'PointedEars' Lahn
    Jul 5, 2004
  5. Replies:
    3
    Views:
    673
Loading...

Share This Page