↑  ←  Описание функции


_IETableWriteToArray

Reads the contents of a Table into an array.

#include <IE.au3>
_IETableWriteToArray(ByRef $o_object [, $f_transpose])

Параметры

$o_object Переменная объекта InternetExplorer.Application, Table object
$f_transpose [необязательный] Boolean value specifying whether to swap the rows and columns in the output array

Возвращаемое значение

Успех:Возвращает a 2-dimensional array containing the contents of the Table
Ошибка:Возвращает 0 и устанавливает @error
@error:0 ($_IEStatus_Success) = Нет ошибок
3 ($_IEStatus_InvalidDataType) = Неверный тип данных
4 ($_IEStatus_InvalidObjectType) = Неверный тип объекта
@extended:Содержит номер неверного параметра

Примечания

When table cells span multiple columns or rows, blank array elements are added to properly align the results. Data in spanning cells will be in the left or uppermost array elements.

Tables are often nested in HTML documents. If all of your data is unexpectedly returned in a single array element, you may need to reference a more deeply nested table to this function.

См. также

_IETableGetCollection

Пример

; *******************************************************
; Пример 1 - Open a browser with the table example, get a reference to the second table
;               on the page (index 1) and read its contents into a 2-D array
; *******************************************************

#include <IE.au3>
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData = _IETableWriteToArray ($oTable)

; *******************************************************
; Пример 2 - Same as Example 1, except transpose the output array and display
;               the results with _ArrayDisplay()
; *******************************************************

#include <IE.au3>
#include <Array.au3>
$oIE = _IE_Example ("table")
$oTable = _IETableGetCollection ($oIE, 1)
$aTableData = _IETableWriteToArray ($oTable, True)
_ArrayDisplay($aTableData)