mjbruder Posted October 13, 2010 Posted October 13, 2010 I need to use IE.au3 functions to get the actual text inside the <option> tags of a dropdown. So far, I can only get the value by using the following code. Unfortunately, the value does not equal the text that I need. $oForm = _IEFormGetObjByName ($oIE, "routeListTwoForm" ) $oForm_dropdown = _IEFormElementGetObjByName ($oForm, "fkcallmanagergroup") $oFormText = _IEFormElementGetValue ($oForm_dropdown) This will return the value of the <option> tag, but it is just a long string of random characters. What I need is the text. <option value=aasdlfkjoaienfioaosviohiasdoijhv>I need this text.</option> Thanks in advance for any help you can provide!
PsaltyDS Posted October 13, 2010 Posted October 13, 2010 (edited) If it's a selection group with options under it, you don't want the value property of the selection, you want the innerText of the option index that is currently selected: #include <IE.au3> $oIE = _IE_Example("form") $oForm = _IEFormGetObjByName($oIE, "ExampleForm") $oSelect = _IEFormElementGetObjByName($oForm, "selectExample") _IEFormElementOptionselect($oSelect, "midipage.html", 1, "byValue") $iSelIndex = $oSelect.selectedIndex $oOption = _IETagNameGetCollection($oSelect, "option", $iSelIndex) $sSelText = $oOption.innerText ConsoleWrite("Index selected = " & $iSelIndex & "; text = " & $sSelText & @LF) Edited October 13, 2010 by PsaltyDS 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now