为了账号安全,请及时绑定邮箱和手机立即绑定

HtmlAgilityPack xpath问题 !!!

HtmlAgilityPack xpath问题 !!!

隔江千里 2018-12-07 11:01:16
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
提交
取消
意见反馈 帮助中心 APP下载
官方微信