<table>
<tr>
<th class="a">Name</th>
<th class="b">Old </th>
<th class="x">New</th>
</tr>
</table>
在上面使用X-path的片段中,我需要获取相对于节点“tr”的“th”的索引,该索引为3。我该如何实现?
我尝试使用XPath表达式来查找节点:
//aside//table//tr/th[text() = 'New']
但我不知道如何找到它的相关索引
是否有轴指定符来获取它的索引?