using xpath, how do you select the n-th option ?
<select>
<option></option>
<option></option>
</select>
/html/body/select/option[?]
xpath
using xpath, how do you select the n-th option ?
<select>
<option></option>
<option></option>
</select>
/html/body/select/option[?]
Best Answer
what you have is correct:
for the 2nd option, use:
or
See http://www.w3.org/TR/xpath#location-paths
Edit
Note that the above assumes you have a structure like:
If your select is inside of a parent other than body, then you either want to use something like:
or
Of course, since your select probably has a name attribute, you could use that, e.g.