Jump to content

_IEFormElementGetCollection <- Need all .name


Recommended Posts

hello autoit friends,

How to collect all names of the objects in a form?

The autoit-help-file does not help me at this point.

I need a routine like this:

$oForms = _IEFormGetCollection ($oIE)
  MsgBox(0, "Forms Info", "There are " & @extended & " forms on this page")
  For $oForm In $oForms
  MsgBox(0, "Form Info", $oForm.name)
Next

Any ideas?

Thx in advanced.

Link to comment
Share on other sites

Try this:

#include <IE.au3>

_IEErrorHandlerRegister()

$sMsg = ""
$oIE = _IE_Example("Form")
$colForms = _IEFormGetCollection($oIE)
For $oForm In $colForms
    $sMsg &= "Form:  " & $oForm.id & @LF
    $colElements = _IETagNameAllGetCollection($oForm)
    For $oElement In $colElements
        $sMsg &= @TAB & "Tag = " & $oElement.tagname & "; .id = " & $oElement.id & "; .name = " & $oElement.getAttribute("name", 2) & @LF
    Next
Next

ConsoleWrite($sMsg)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

If you are analyzing web sites, you would do much better with DOM Inspectors, like DebugBar for IE, or FireBug for Firefox.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...