0
<table>
<tr>...</tr>
....
<tr>NodeToSelect</tr>
<tr>..</tr>
<tr class="SomeClass">CurrentNode</tr>
...
</table>

我有一个 HtmlNode 对象,它-tr class="SomeClass"CurrentNode-在某些功能中指示:

string Proccess(HtmlNode node)
{
    //need select 
}

如何通过 Xpath 从此函数中获取节点 -NodeToSelect-?

4

1 回答 1

1
preceding-sibling::tr[text()="NodeToSelect"]
preceding-sibling::tr[2]
于 2013-05-17T13:05:56.047 回答