html - How to I get in xpath the value of the option and not the display value? -
consider example
<select> <option value="http://www.test1.com"> 1 </option> <option value="http://www.test2.com"> 2 </option> <option value="http://www.test3.com"> 3 </option> </select>
how in xpath value of option , not display? meaning, want value of option element - http://www.test1.com example , not 1, 2 or 3.
by position:
/select/option[1]/@value
by content:
/select/option[.=1]/@value
or
/select/option[normalize-space()='1']/@value
Comments
Post a Comment