scooper Posted June 4, 2009 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
Valuater Posted June 4, 2009 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)
scooper Posted June 4, 2009 Author 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
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