dickep Posted March 11, 2010 Posted March 11, 2010 (edited) OK, I have tried to figure out how to loop through the tables in an IE web page. I have a webpage at work that has between 5 and 30 tables (tables inside tables inside tables.... you know). So, I need to know each one and then can figure out what to do with them. I have done the code below, but it never gets activated. So, need some guidance to make this work better (or, really, work at all). Thanks, E @oIE = _IECreate("http://",1,1) ; I put in the full URL when needed. $oTable = _IETableGetCollection($oIE) $iNumTables = @extended ; this give me a number of total tables in page for $count = 0 to $iNumTables - 1 $oTable = _IETableGetCollection($oIE, $count) ; redundant, but .... $aTableData = _IETableWriteToArray($oTable) _ArrayDisplay($aTableData, "Table #" & $count) next Edited March 11, 2010 by dickep
PsaltyDS Posted March 11, 2010 Posted March 11, 2010 (edited) Try it this way: #include <IE.au3> #include <Array.au3> $oIE = _IECreate("http://someurl.com", 1, 1) $colTables = _IETableGetCollection($oIE) If @error Then Exit $iIndex = 0 for $oTable In $colTables $aTableData = _IETableWriteToArray($oTable) _ArrayDisplay($aTableData, "Table #" & $iIndex) $iIndex += 1 next Edited March 11, 2010 by PsaltyDS 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
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