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

N

neil.fitzgerald

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
 
P

Paul McGuire

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
 
P

Paul McGuire

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
 
P

Paul Rubin

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?
 
N

neil.fitzgerald

Paul said:
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.
 

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

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top