Jump to content
Sign in to follow this  
Kamakazy

Select item based on revolving identifier.

Recommended Posts

Kamakazy

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.

Share this post


Link to post
Share on other sites
jdelaney

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
  • Like 1

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.

Share this post


Link to post
Share on other sites
Kamakazy

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
  • Like 1

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.