AlexVong Posted November 15, 2012 Share Posted November 15, 2012 Very slow _IETableWriteToArray#include #include ;no check errors $sUrl = @ScriptDir & '\test.htm' $oIE = _IECreate($sUrl) $oTable = _IETableGetCollection($oIE, 3) $aTable = _IETableWriteToArray($oTable, True) _IEQuit($oIE) $oExcel = _ExcelBookNew() _ExcelWriteSheetFromArray($oExcel, $aTable, 1, 1, 0, 0) _ExcelBookSaveAs($oExcel, @ScriptDir & '\Test.xls', 'xls', 0, 1) _ExcelBookClose($oExcel)Table 30 000 - 50 000 linesWhat alternative? Link to comment Share on other sites More sharing options...
Andreik Posted November 15, 2012 Share Posted November 15, 2012 (edited) Well, AutoIt loops are slow and this function use a lot of loops. The alternative it's to try access data directly from table object without put it into an array. Edit: typo error Edited November 16, 2012 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
sleep365 Posted November 16, 2012 Share Posted November 16, 2012 (edited) yes ,it just very slow ,you can use StringRegExp Function to get cell,you can try the code . $sText = _IEDocReadHTML($oIE) $aTableData = StringRegExp($sText,'(?<=>)[^<v"]+(?=<)',3) _ArrayDisplay($aTableData) Edited November 16, 2012 by sleep365 Link to comment Share on other sites More sharing options...
AlexVong Posted November 17, 2012 Author Share Posted November 17, 2012 Example....table.htm Link to comment Share on other sites More sharing options...
sleep365 Posted November 20, 2012 Share Posted November 20, 2012 (edited) #include <IE.au3> #include <Array.au3> $sUrl = @ScriptDir & '\table.htm' $oIE = _IECreate($sUrl) _IELoadWait($oIE) $htmltxt = _IEBodyReadHTML ( $oIE ) MsgBox(0,'t0',$htmltxt) $aTableData = StringRegExp($htmltxt,'(?<=>)[^<\v"]+(?=<)',3) _ArrayDisplay($aTableData) I use the code ,get the result. Edited November 20, 2012 by sleep365 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