VB.NET how can I click on this dropdown box?

simpleonline12

New member
Sep 29, 2009
191
3
0
Code:
<select id="questions" name="selection" >
  <option value="choosequestion" style="font-style:italic;">
  Choose a question ...
  </option>
  <option value="What is the name of your best friend from childhood?"
 
    >What is the name of your best friend from childhood?</option>
  <option value="What was the name of your first teacher?"
 
    >What was the name of your first teacher?</option>
  <option value="What is the name of your manager at your first job?"
 
    >What is the name of your manager at your first job?</option>
  <option value="What was your first phone number?"
 
    >What was your first phone number?</option>
  <option value="What is your vehicle registration number?"
 
    >What is your vehicle registration number?</option>
  <option value="What is your library card number?"<select id="questions" name="selection" >
  <option value="choosequestion" style="font-style:italic;">
  Choose a question ...
  </option>
  <option value="What is the name of your best friend from childhood?"
 
    >What is the name of your best friend from childhood?</option>
  <option value="What was the name of your first teacher?"
 
    >What was the name of your first teacher?</option>
  <option value="What is the name of your manager at your first job?"
 
    >What is the name of your manager at your first job?</option>
  <option value="What was your first phone number?"
 
    >What was your first phone number?</option>
  <option value="What is your vehicle registration number?"
 
    >What is your vehicle registration number?</option>
  <option value="What is your library card number?"


I haven't been able to grab an elements an auto select it from the page. Got any ideas on how to go about getting this to work?
Thanks.

Here's something that I've slapped gather and it does do anything

Code:
   For
 Each element As HtmlElement In WebBrowser1.Document.GetElementsByTagName("select")(0).GetElementsByTagName("option")
            If element.InnerText = "What is the name of your best friend from childhood?" Then
                element.SetAttribute("selected", "True")
            End If
        Next