Function Reference

_IETagNameGetCollection

Returns a collection object of all elements in the object with the specified TagName.

#include <IE.au3>
_IETagNameGetCollection ( ByRef $o_object, $s_TagName [, $i_index = -1] )

 

Parameters

$o_object Object variable of an InternetExplorer.Application, Window, Frame, iFrame or any object in the DOM
$s_TagName TagName of collection to return (e.g. IMG, TR etc.)
$i_index Optional: specifies whether to return a collection or indexed instance
0 or positive integer returns an indexed instance
-1 = (Default) returns a collection

 

Return Value

Success: Returns an object variable containing the specified Tag collection, @EXTENDED = specified Tag count
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
5 ($_IEStatus_InvalidValue) = Invalid Value
7 ($_IEStatus_NoMatch) = No Match
@Extended: Contains invalid parameter number

 

Remarks

The DOM is hierarchical, so if the object passed is the document object, the specified elements in the document are returned. If the object passed is an object inside the document (e.g. a TABLE object), then only the specified elements inside that object are returned.

 

Related

_IETagNameAllGetCollection

 

Example


; *******************************************************
; Example 1 - Open a browser with the form example, get the collection
;               of all INPUT tags and display the formname and type of each
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("form")
$oInputs = _IETagNameGetCollection ($oIE, "input")
For $oInput In $oInputs
    MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.type)
Next