我一直在尝试使用 HtmlAgilityPack 获得以下值,但没有成功。我正在使用 SelectSingleNode。
这是我的html。
<html>
<body>
<table>
<tr><td>One</td></tr>
</table>
</body>
</html>
下面是代码隐藏。
HtmlDocument doc = new HtmlDocument();
doc.Load("C:\\test.html");
HtmlNode test = doc.DocumentNode.SelectSingleNode("/html/body/table/tbody/tr/td");
Console.WriteLine(test.InnerHtml);
( test
HtmlNode) 变量为空。
我将如何获得其中的价值One
。