gimx Posted January 18, 2008 Share Posted January 18, 2008 Hello, I need help with Select and Option plz. This is the webpage code : <select class="dropdown" id="pagselect" style=""> <option value="1">1</option> <option value="3">3</option> <option value="5">5</option> <option value="10">10</option> </select> By defaut, the listbox is set at 1. I get the Select tag in a variable with _IETagNameGetCollection. Now, how can i set the option value at 10 for example ? Thx Link to comment Share on other sites More sharing options...
nobbe Posted January 19, 2008 Share Posted January 19, 2008 i did it in a different script like this , you will need to figure out the form element first ; die erste FORM .. $oForm = _IEFormGetCollection($oIE, 0) $oQuery = _IEFormElementGetCollection($oForm, 1) ;; erstes element If $oQuery <> 0 Then ;; no form found -- ;MsgBox(0, "Form Element Value", _IEFormElementGetValue ($oQuery)) $opt="3"; the one you wish to select ; wenn wir den text gefeunden haben ?? ansonsten nichts machen If _IEFormElementOptionselect($oQuery, $opt, 1, "byText") Then ; MsgBox(0, "Option Selected", "Option " & $opt & " selected " ) _IEFormSubmit($oForm) ; submit on default form Else ; ging nicht.. ; MsgBox(0, "Option Selected", "Option " & $opt & " NOT !! selected " ) EndIf EndIf Link to comment Share on other sites More sharing options...
gimx Posted January 19, 2008 Author Share Posted January 19, 2008 Thx but that don't work because the Select tag is not in a Form tag (it's my problem...). This Select tag is build by a javascript apparently. I have really no idea to set Option without using _IEForm function. If someone have an idea... Thx Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 19, 2008 Moderators Share Posted January 19, 2008 Something like this should work... #include <IE.au3> $oIE = _IE_Example("form") $oSelect = _IETagNameGetCollection($oIE, "select", 0) _IEFormElementOptionselect($oSelect, "Freepage", 1, "byText") Link to comment Share on other sites More sharing options...
gimx Posted January 19, 2008 Author Share Posted January 19, 2008 (edited) Thx but don't work This is the page where i have the problem. Open it and click on the tab "Ses entraineurs". You have the combobox in bottom of the page (with values 15 30 50 100).Now look at the source. There are no Select tag. Now look with Firebug for example, there are Select tag.This page is strange... Edited January 19, 2008 by gimx Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 19, 2008 Moderators Share Posted January 19, 2008 Try this... #include <IE.au3> $sURL = "http://www.geny.com/FicheJockey?id_jockey=1008701&info=Julien%20Raffestin" $oIE = _IECreate($sURL) _IELinkClickByText($oIE, "Ses entraƮneurs") $oDIV = _IEGetObjById($oIE, "entraineursTab") $oSelect = _IETagNameGetCollection($oDIV, "select", 0) While Not _IEFormElementOptionselect($oSelect, 100) Sleep(10) WEnd Link to comment Share on other sites More sharing options...
gimx Posted January 19, 2008 Author Share Posted January 19, 2008 Yes, that work ! Thx a lot Daddy Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted January 19, 2008 Moderators Share Posted January 19, 2008 Yes, that work !Thx a lot Daddy You're welcome, glad I was able to help. 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