public static readonly string xpath = "/html/body/div[6]/div[2]/div[1]/ul[1]/li", url = "www.zerodm.cn";
string html = HAPCommon.GetHtmlContentByURL(string.Format("http://{0}/", url));
HtmlAgilityPack.HtmlDocument htmldoc = new HtmlAgilityPack.HtmlDocument();
htmldoc.LoadHtml(html); HtmlNodeCollection nodes = htmldoc.DocumentNode.SelectNodes(xpath);
//HtmlAgilityPack.HtmlNode xhtml = new HtmlAgilityPack.HtmlNode(HtmlAgilityPack.HtmlNodeType.Element,htmldoc, 0);
return nodes;
Nodes is null
xpath 是用 Firebug 找到的路径
1 回答
- 1 回答
- 0 关注
- 413 浏览
添加回答
举报
0/150
提交
取消