let the Webbrowser control click on an option element?

Html code:


<span id="syi-attribute-1277" class="dropdown l-stretchable-fixed native" tabindex="7146"> <input type="hidden" value="" name="attribute[1277]"></input> <span class="label" style=""></span> <span class="pointer"></span> <select class="item-frame" size="1" style="height: 30px; width: 264px;"> <option class="item" value=""></option> <option class="item" value="7146"></option> <option class="item" value="7147"></option> <option class="item" value="7148"></option> </select> </span> 


What I'd like to do is the webbrowser control in my form (using WinForms) be able to select the third option of this drop down selection list (with the value of 7148). What I've tried so far:


doc.GetElementById("syi-attribute-1277").Children.GetElementsByName("option [0].SetAttribute("value", "7148"); 


^ makes the most sence, though sadly it gives me this error: Additional information: Value of '0' is not valid for 'index'. 'index' should be between 0 and -1.


doc.GetElementById("syi-attribute-1277").SetAttribute("tabindex", "7148"); 


^ Nothing happens.


Any clue's? Thank you very much in advance! 🙂

by Auxilium11 via /r/csharp

Leave a Reply