Jump to content
Sign in to follow this  
gimx

Select tag and Option

Recommended Posts

gimx

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

Share this post


Link to post
Share on other sites
nobbe

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

Share this post


Link to post
Share on other sites
gimx

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

Share this post


Link to post
Share on other sites
gimx

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

Share this post


Link to post
Share on other sites
big_daddy

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

Share this post


Link to post
Share on other sites
gimx

Yes, that work !

Thx a lot Daddy :D

Share this post


Link to post
Share on other sites
big_daddy

Yes, that work !

Thx a lot Daddy :D

You're welcome, glad I was able to help.

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  

×