Jump to content

Select tag and Option


gimx
 Share

Recommended Posts

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 :D

Link to comment
Share on other sites

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

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 :D

Link to comment
Share on other sites

Thx but don't work :D

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 by gimx
Link to comment
Share on other sites

  • Moderators

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

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