문제

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?

도움이 되었습니까?

해결책

Use this XPath:

//*[contains(text(),'City')]/following-sibling::text()[1]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top