I've slowly been delving into using the WebBrowser control to build an application that controls navigation and data retrival of a web site using VB. I need to know how to 'parse' the contents within a <select>..</select> tag pair (actually, <option>..</option> tags) so I can retrieve the entire values of the VALUE and TEXT properties. I want to recreate the values within a web <select>..</select> into a VB Combo Box.

I've played with getElementsByTagName and collecting all <option> tag objects. I can then get the .value and .text properties of each object in the collection, but I haven't found a way to define the name of the parent <select> tag. This is needed in case there is more than one <select>..</select>. Also, I need to take into account that the <option> tags may be the children of an <optgroup>, in which case, I believe, the parent of the <option> is the <optgroup>. In this case I'd still want to retrieve ALL <option> tag references.

An example is:
<select name="q">
<optgroup label="group1">
<option value="-1">Please make a selection</option>
</optgroup>
<optgroup label="group2">

<option value="1">Selection 1</option>
<option value="2">Selection 1</option>
<option value="3">Selection 1</option>
<option value="4">Selection 1</option>
</optgroup>
</select>

In this example, I'd need to identify all option values and text that are children of "q"

Thanks,
Doug