scooper Posted June 4, 2009 Share Posted June 4, 2009 (edited) Hi all, I have a site with some javascript link with the same tagname, i need to click all this tag, this is my script : CODE for $i to 5 step 1 _IENavigate($oIe, "www.yyy.com") $oAs = _IETagnameGetCollection($oIE, "A") For $oA in $oAs If String($oA.innerText) = "x" Then _IEAction($oA, "click") ExitLoop EndIf Next _IELoadWait ($oIE) _IELinkClickByIndex ($oIE, 66) next This script works but unlike i can't know how many tag with "x" name I have in the page, so i need a function to count the number of tagname with x thanks in advance for any help Edited June 5, 2009 by scooper Link to comment Share on other sites More sharing options...
Valuater Posted June 4, 2009 Share Posted June 4, 2009 Maybe... Dim $count For $i = 1 To 5 Step 1 _IENavigate($oIe, "www.yyy.com") $oAs = _IETagNameGetCollection($oIe, "A") For $oA In $oAs If String($oA.innerText) = "x" Then $count += 1 _IEAction($oA, "click") ExitLoop EndIf Next _IELoadWait($oIe) _IELinkClickByIndex($oIe, 66) Next MsgBox(4096, "count", $count) *** NOT TESTED 8) Link to comment Share on other sites More sharing options...
scooper Posted June 4, 2009 Author Share Posted June 4, 2009 (edited) Thankyou Valuater, your code works fine, from your I found this solution to count the number of laps to goCODEdim $Count $oAs = _IETagnameGetCollection($oIE, "A") For $oA in $oAs If String($oA.innerText) = "x" Then $Count +=1 EndIf Next thanks again Edited June 5, 2009 by scooper Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now