Jump to content
Sign in to follow this  
Monty

List boxes on webpage

Recommended Posts

Monty

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

Share this post


Link to post
Share on other sites
Authenticity

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

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.