我正在构建一个应用程序来从网站中提取新闻项目,但是无法让它找到带有 dd 标签的节点
关于我哪里出错的任何想法?
HTML
<h1>INFO: New Prices</h1>
<dl class='table'>
<dt>Department:</dt><dd>Sales</dd>
<dt>Start Date:</dt><dd>28/06/2012</dd>
<dt>End Date:</dt><dd>20/07/2012</dd>
<dt>Approved Date:</dt><dd>Jun 28 2012 3:11PM</dd>
</dl>
C# 代码
public void CollectNewsItem(UInt64 aSID)
{
String URL = WebReader.storyLink + "?SID=" + aSID;
HtmlWeb hw = new HtmlWeb();
HtmlDocument document = hw.Load(URL);
HtmlNode n = document.DocumentNode.SelectSingleNode("//h1");
Console.WriteLine("Title: " + n.InnerText);
HtmlNodeCollection nodes = document.DocumentNode.SelectNodes("//dd");
foreach (HtmlNode node in nodes)
{
Console.WriteLine(node.InnerText);
}
}