Jump to content

Recommended Posts

Posted

Hello!

Help me, please.

I need to click a button on a web page, but it did not have any ID or Name.

Here is the code:

<button style="width: 110px;" onclick="doonsubmit()" type="submit">
Posted (edited)

Check out manual -> UDF -> IE.

There might be some helpers for enumerating website buttons and inspecting their properties.

Naturally there I looked, there IEFormElementGetObjByName, but this button has no "Name" Edited by brezenix
Posted

Naturally there I looked, there IEFormElementGetObjByName, but this button has no "Name"

Get all the elements with _IEFormElementGetCollection and loop through them until you find one whose .Type is "submit".

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

Get all the elements with _IEFormElementGetCollection and loop through them until you find one whose .Type is "submit".

Like this?

$oButtons = _IETagNameGetCollection ($oIE, "button")
For $oButton In $oButtons
    If $oButton.type = "submit" Then    _IEAction ($oIE, "click")
Next
Posted

Like this?

$oButtons = _IETagNameGetCollection ($oIE, "button")
 For $oButton In $oButtons
    If $oButton.type = "submit" Then    _IEAction ($oIE, "click")
 Next

Did you try it? Did it work?

I would replace _IETagNameGetCollection with _IEFormElementGetCollection though.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Posted

Did you try it? Did it work?

I would replace _IETagNameGetCollection with _IEFormElementGetCollection though.

No, I'm at home now and I not have Windows >_< I will try it on Monday at the work.
Posted

This is work:

$oButtons = _IETagNameGetCollection ($oIE, "button")
 For $oButton In $oButtons
    If $oButton.type = "submit" Then _IEAction ($oButton, "click")
 Next
Posted

Also you have to keep in mind that this will only click the first button in the collection.

If you have several buttons and you want to click not on the first button you have to think of something else to identify it.

Posted

Also you have to keep in mind that this will only click the first button in the collection.

If you have several buttons and you want to click not on the first button you have to think of something else to identify it.

Thank you. I'm aware of. Fortunately there is only one button to "submit" >_<

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...