Jump to content

List boxes on webpage


 Share

Recommended Posts

Hi guys, just a quick question...how do I select items from a list box on any webpage.

I have attached a htm file (just as an example) and lets say I wanted to select "Item Three" from it.

#include <IE.au3>

$oIE = _IECreate("Test.htm") ; full link or path required.

$oForm = _IEGetObjByName($oIE, "LIST_BOX_1") ???

Please help. Thank you kindly

Test.htm

Link to comment
Share on other sites

#include <IE.au3>

Dim $oIE = _IE_Example('form')
Dim $oSelect = _IEGetObjByName($oIE, 'selectExample')
$oSelect.scrollIntoView()
MsgBox(0x40, 'Info', $oSelect.item($oSelect.selectedIndex).innerText)
_IEFormElementOptionselect($oSelect, '2', 1, 'byIndex')
MsgBox(0x40, 'Info', $oSelect.item($oSelect.selectedIndex).innerText)

So you can select byIndex, byValue, byText, or interacting directly with the object properties or methods. Read the help file for the _IEFormElementOptionselect() function description.

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...