Sign in to follow this  
Followers 0
Novox

Any function in IE.au3 to list all web controls?

6 posts in this topic

Hello,

I would like to know any function in IE.au3 or others can list all website controls (textbox, dropdownlist, checkbox, radio button, button, etc.) in the page with their name/id and value?

Thank you very much,

Novox

Share this post


Link to post
Share on other sites



Not that I recall, but the way to do that would be to get all the forms, get all elements under each form and from then on you could get all the properties of each of them, it would just really take about 2 loops.

Share this post


Link to post
Share on other sites

Not that I recall, but the way to do that would be to get all the forms, get all elements under each form and from then on you could get all the properties of each of them, it would just really take about 2 loops.

Would you please give me a hint which command I can use to get all the forms and get all elements?

Thanks again!

Share this post


Link to post
Share on other sites

_IEFormGetCollection returns a collection of all forms in an IE window

_IEFormElementGetCollection returns a collection of all elements in a form.

Share this post


Link to post
Share on other sites

#include <IE.au3>
$oie = _IECreate('http://www.google.com')
Sleep(100)
$oforms = _IEFormGetCollection($oie,-1)
For $oform In $oforms
    ConsoleWrite($oform.name & @CRLF);
    $oeles = _IEFormElementGetCollection($oform)
    For $oele In $oeles
        ConsoleWrite(@TAB & 'Name: ' & $oele.name & ' Tag Type: ' & $oele.tagName &@CRLF)
    Next
Next

A small demonstration

Share this post


Link to post
Share on other sites

Thank you very much for your quickly reply :mellow:

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  
Followers 0