computergroove Posted August 8, 2015 Share Posted August 8, 2015 I want to retrieve all the div id's in an IE window, count them and list them. I want this in an array. I have tried several of the _IE functions with no luck. I seem to be getting stuck on getting the window handle of the IE window.#include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Local $oIE = _IECreate("www.youtube.com") Sleep(5000) $aArray = _IETagNameGetCollection ($oIE, "div") MsgBox(0,0,$oIE) _ArrayDisplay($aArray)The MsgBox doesn't even show up so I imaging thats why the array also doesn't show. What am I missing? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
mikell Posted August 8, 2015 Share Posted August 8, 2015 Looks like you're confusing object/string and collection/arrayPlease try this#include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Local $oIE = _IECreate("www.autoit.fr") Sleep(3000) $oDivs = _IETagNameGetCollection ($oIE, "div") Local $res For $oDiv In $oDivs If $oDiv.id <> "" Then $res &= $oDiv.id & @crlf Next MsgBox(0,"", $res) $aArray = StringSplit($res, @crlf, 3) _ArrayDisplay($aArray) Link to comment Share on other sites More sharing options...
computergroove Posted August 8, 2015 Author Share Posted August 8, 2015 (edited) The above lists all the div id's on the page. It does not list any nested DIV's. Can you breakdown what the line: If $oDiv.id <> "" Then $res &= $oDiv.id & @crlfI dont fully understand what is happening. Edited August 8, 2015 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
mikell Posted August 8, 2015 Share Posted August 8, 2015 Same way but using $oDiv.classname Link to comment Share on other sites More sharing options...
computergroove Posted August 8, 2015 Author Share Posted August 8, 2015 Where can I find the tags like .classname or .id and others? Where can I find more info on understanding how autoit teanslates "For $oDiv To $oDivs". Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html 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