Jump to content

_IETableWriteToArray - medley works


AlexVong
 Share

Recommended Posts

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 lines

What alternative?

Link to comment
Share on other sites

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 by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

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 by sleep365
Link to comment
Share on other sites

#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 by sleep365
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...