mailmaster Posted February 3, 2009 Share Posted February 3, 2009 (edited) Is it posible to get all the text of the Options in a field select of a form using the _IE object? I tryied _IEFormElementGetCollection & _IEFormElementOptionselect without success... I have in a form <select name="actDatos" size=5> <option value="4"> ANÁLISIS CLÍNICOS </option> <option value="30"> FISIOTERAPIA </option> <option value="51"> MEDICINA GENERAL / DE FAMILIA </option> ... </select> and I want to get all the text of all of the options. Edited February 3, 2009 by mailmaster Link to comment Share on other sites More sharing options...
mailmaster Posted February 3, 2009 Author Share Posted February 3, 2009 Is it posible to get all the text of the Options in a field select of a form using the _IE object? I tryied _IEFormElementGetCollection & _IEFormElementOptionselect without success... I have in a form <select name="actDatos" size=5> <option value="4"> ANÁLISIS CLÍNICOS </option> <option value="30"> FISIOTERAPIA </option> <option value="51"> MEDICINA GENERAL / DE FAMILIA </option> ... </select> and I want to get all the text of all of the options. The answer was found in the forum: http://www.autoitscript.com/forum/index.php?showtopic=61538 via $oSelect = _IEFormElementGetObjByName ($oFormulario, "actDatos") For $oItem In $oSelect.options $sItems=$oItem.text & @CRLF Next Link to comment Share on other sites More sharing options...
DaleHohm Posted February 3, 2009 Share Posted February 3, 2009 Is it posible to get all the text of the Options in a field select of a form using the _IE object? I tryied _IEFormElementGetCollection & _IEFormElementOptionselect without success... I have in a form <select name="actDatos" size=5> <option value="4"> ANÁLISIS CLÍNICOS </option> <option value="30"> FISIOTERAPIA </option> <option value="51"> MEDICINA GENERAL / DE FAMILIA </option> ... </select> and I want to get all the text of all of the options.IE.au3 does not provide a convenience function for this, you need to use the DOM. For example: #include <IE.au3> $oIE = _IECreate(your-url) $oSelect = _IEGetObjByName($oIE, "actDatos") $oOptions = $oSelect.options For $oOption in $oOptions ConsoleWrite("Value: " & $oOption.value & " Text: <" & $oOption.text & ">" & @CRLF) Next Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
mailmaster Posted February 3, 2009 Author Share Posted February 3, 2009 IE.au3 does not provide a convenience function for this, you need to use the DOM. For example: #include <IE.au3> $oIE = _IECreate(your-url) $oSelect = _IEGetObjByName($oIE, "actDatos") $oOptions = $oSelect.options For $oOption in $oOptions ConsoleWrite("Value: " & $oOption.value & " Text: <" & $oOption.text & ">" & @CRLF) Next DaleThank you very much and by my side this thread can be closed. Link to comment Share on other sites More sharing options...
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