I have a simple table like this one:
<table>
<tbody><tr>
<th> Name1 </th>
<td>
A
</td>
</tr>
<tr>
<th>Name2</th>
<td>
B
</td>
</tr>
</tbody></table>
I need the XPath to the value B, which I can do with:
//table/tbody/tr[2]/td[1]
However this relies on the position of the row (the number 2), which may change from one example to another. I would like to get the XPath of element B but using the header name (Name2) instead of the position.
Any idea of how to get it?