I would like to use XPATH to retrieve table data.
The table data is as follows:
"At this time, you can specify ""number of people"" and ""average height"" by entering the following, but I don't know how to get ""5"" and ""170"" underneath them, so I would like to ask you a question."
/table/tr [td [contains (normalize-space(), "average height")]]
*We would like to use the same XPATH for the number of people and average height except within
<table>
<tr>
<td>Number of people</td>
<td>Average Height</td>
</tr>
<tr>
<td>5</td>
<td>170</td>
</tr>
</table>
With XPath 2.0, you can write like this.
for $i in 1 to count(/table/tr[1]/td) return if(contains(/table/tr[1]/td[$i], 'average weight'))then string(/table/tr[2]/td[$i])else()
Run XPath/XQuery Builder on Xygen 20.0 Screen:
Run Screen "src="https://i.stack.imgur.com/6LY35.png"/>
in Run Screen "src="https://i.stack.imgur.com/ajxk5.png"/> in
© 2024 OneMinuteCode. All rights reserved.