what you have right:
for the second option use:
/html/body/select/option[2]
or
/html/body/select/option[position()=2]
See http://www.w3.org/TR/xpath#location-paths
Edit
Note that the above assumes that you have a structure such as:
<html>
<body>
<select>
<option></option>
<option></option>
</select>
</body>
</html>
If your choice is inside a parent other than the body, then you either want to use something like:
/html/body/div[@class='header']/select/option[2]
or
//select/option[2]
Of course, since your choice probably has a name attribute, you can use it, for example.
//select[@name='myselect']/option[2]
source
share