I want to extract the first value which has the property selected = "selected"
using XPath extractor. But it doesn't seem to work for me.
The html which i'm extracting the value from is:
< select id="ddLocation" name="ddLocation" class="DDlocation" size="1" onchange="jsf.util.chain(this,event,'onLocationChange();,'mojarra.ab(this,event,\'valueChange\',\'@this\',0)')"> <br>
< option value="43" selected="selected">Pune</option> <br>
< option value="44">Agra< /option> <br>
< option value="45">Guntur< /option> <br>
< option value="46">Kochi< /option> <br>
< option value="73">Kothrud< /option> <br>
< option value="153">Ratnagiri< /option> <br>
< option value="156">Baner< /option>
My XPath query is:
//select[@id="ddLocation"]/option[1]/@value
Is it wrong?
Can anyone suggest me any better / right approach please?