Jump to content

How to click button in IE without ID and Name


Recommended Posts

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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" >_<
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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