Jump to content

Reading the Values in a Drop Down


Recommended Posts

Hello,

I need to assign the choices that are available in A Drop Down to variables in My script.

I used the code below to get the choices that are in the drop down, however I dont

see any way to determine where one Choice ends and the Next Begins

The Choices in the Prompts change so there is no way before the script runs to know what

choices ar available to select from

Below is the code Im using, How would I parse them to get each individual selection

Listed below are the first 3 choices from the drop down.

I dont see any special characters to identify where one ends and the next begins

eSMART Team Web Users

GWIM BAI AML Web Users

GWIM Basic Web Role

Dim $oTag = _IETagNameGetCollection($oIE, 'select', 1)

ConsoleWrite($oTag.InnerText & @crlf)

It returns

eSMART Team Web UsersGWIM BAI AML Web UsersGWIM Basic Web

Link to comment
Share on other sites

This should get you moving in the right direction:

#include <IE.au3>

_IEErrorHandlerRegister()

$oIE = _IEAttach("Window Title")

Local $oTag = _IETagNameGetCollection($oIE, 'Select', 0)

Local $oOptions = _IETagNameGetCollection($oTag, "option")

For $oOption In $oOptions
ConsoleWrite($oOption.value & @crlf)
ConsoleWrite($oOption.innerHTML & @crlf)
Next
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...