<div id="a_1" class="c_1">
<h3><img src="image.png" alt="image text" />versions</h3>
<div>
<dl>
<dt>V1</dt>
<dd>14</dd>
<dt>V2</dt>
<dd>5776</dd>
</dl>
</div>
</div>
我怎么能得到14?我试过这样的事情:
document.DocumentNode.SelectSingleNode("//div[@class='c_1']//a[@href]");
答案 0 :(得分:2)
这应该有效:
document.DocumentNode.SelectSingleNode("//div[@class='c_1']//dd[1]");
OR
document.DocumentNode.SelectSingleNode("//div[@class='c_1']/div/dl/dd[1]");