Jump to content

Select item based on revolving identifier.


Kamakazy
 Share

Recommended Posts

Hey Guys & Girls.

Yet another obsticle Im faced with.

First the HTML.

<input type="button" value="I Agree" class="Next inputSubmit" id="Next_12961042">

As you can see, this is indeed a button, and yes, not in a form or anything usefull exept for the "ID".

Now the snag, the ID changes very often, but only the number part. the "Next_" stays the same.

I wanted to use _IEGetObjByName but obviously that wont work as there is no Name.

If I hit the obj based on full ID, it clics but like I said, the numbers change.

Is there a way that I can hook onto the "Next_" regardless of what is behind it. a wildcard of some sort?

Im not asking for you to write me the code, just push me in the right direction.

Please shout if im too vague.

Kama.

Link to comment
Share on other sites

you can loop through the collection (use .getElementsByTagName()), or use my signature to use the xpath to get the object.

where

xpath = "//input[contains(@id,'Next_')]"

the return is an array

http://www.w3schools.com/htmldom/dom_methods.asp

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

you can loop through the collection (use .getElementsByTagName()), or use my signature to use the xpath to get the object.

where

xpath = "//input[contains(@id,'Next_')]"

the return is an array

http://www.w3schools.com/htmldom/dom_methods.asp

Great stuff, Thanx the help.

UPDATE:

I got it working. Thanx for the help.

Kama

Edited by Kamakazy
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...