Jump to content
Sign in to follow this  
Champak

_IETagNameGetCollection index question

Recommended Posts

Champak

Is the index suppose to return the position/instance of the tag I'm looking for? Ex. if I want the innertext of the 2nd "h2" that appears in the web page aren't I suppose to do:

$oElements = _IETagNameGetCollection ($oIE, "h2", 2)

        For $oElement In $oElements
            ConsoleWrite( "!=String: " & $oElement.innertext & @CRLF & @CRLF)
        Next

When I take away the 2 in the getcollection, it returns all the innertext from all of the h2s.

Or am I misunderstanding the index parameter?

Share this post


Link to post
Share on other sites
SmOke_N

It's zero based.

_IETagNameGetCollection ($oIE, "h2", 1)

Would return the 2nd index.

Edit:

Example:

#include <IE.au3>
$oIE = _IE_Example ("form")
$oInputs = _IETagNameGetCollection ($oIE, "input", 1)
MsgBox(0, "Form Input Type", "Form: " & $oInputs.form.name & " Type: " & $oInputs.type)
Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.