tommytx Posted August 5, 2010 Share Posted August 5, 2010 (edited) Wonder why there is no command "getElementsByTagName" as in javascript..It seems like that would be a very useful tool. so I am trying to modify the next best command.. can someone help me.. Func dolinks_now() $oElements = _IETagNameAllGetCollection ($oIE) For $oElement In $oElements if $oElement.tagname = "h1" then msgbox(0, "", $oElement.innerText) ; Msgbox(0, "", $oElement.tagname & ":" & $oElement.innerText & @CRLF) Next EndFunc When I remove the ; from the msgbox.. that works fine but it gives all of the elements one by one.. What I want to do is extract just one set such as "H1" or "li" you get the idea.. I tried using the If statement but it fails.. Can someone point me to the correct command... And then once I get all the "H1" if there is more than one can I pick it with something like. if $oElement.tagname(2) = "h1" then msgbox(0, "", $oElement.innerText) By adding say a 2 to get the 3rd H1 tag... 0,1,2 Edited August 5, 2010 by tommytx Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 5, 2010 Share Posted August 5, 2010 You didn't see _IETagNameGetCollection() right below _IETagNameAllGetCollection() in the help file? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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