Pregunta

I have an HTML structure of a page like this,

<form align="center" method="post" name="form1">
<input type="hidden" value="J0512-0491" name="jobid">
<input type="hidden" value="1" name="BDID">

<br>
<hr>
<b>Category: </b>
Food & Beverage
<br>
<b>City: </b>
Carlyle, Saskatchewan, Canada
<br>
<b>Job Number: </b>
05012-04191
<br>
<b>Salary Range: </b>
$13.19 - 16.48
<br>
<b>Closing Date: </b>
31/03/2013
<br>
<hr>
<b></b>

I need to extract the text of "City:" i.e "Carlyne,Saskatchewan,Canada" using the xpath. any ideas on how to achieve this?

¿Fue útil?

Solución

Use this XPath:

//*[contains(text(),'City')]/following-sibling::text()[1]
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top