Jump to content
Sign in to follow this  

Issue selecting option from a select in IE

Recommended Posts


Issue can be closed, sorry, fixed myself...

Hi everybody,

I have an issue by selecting an option from a select in IE (on a specific page, a dropdown menu). The form has no name nor ID, so I try to use a _IEFormGetCollection to catch it. The select has a name though, it looks like this:


<form action="XXXXXX" method="get">
<div class="XXXX_glossaryContainer">
          value="0">Glossar w&auml;hlen &hellip;</option>
      <option value="" disabled="disabled" class="unchoosable">&nbsp;</option>
            value="301" >TEST1</option>
            value="133760" >TEST2</option>

So this is the piece of coding that I came with, which is unfornately not selecting anything :( (Is there a way to address the select directly maybe, since it has a name?...

I tried to activate a MsgBox to see if it gets a form and it does say that there is a form existing on the page. I couldn't get further than that :(

#include <IE.au3>
$oIE = _IECreate($url)
$oForm = _IEFormGetCollection($oIE, 0)
$oSelect = _IEFormElementGetCollection($oForm, "1")
_IEFormElementOptionSelect($oSelect, "133760", 1, "byValue")
Any clue? I would be very grateful :)
EDIT: I solved my problem... I had to select 0 in the _IEFormElementGetCollection... because it starts counting at 0...
Edited by NicolasBaldwin

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