使用HTML agility pack选择节点 [英] Using HTML agility pack to select a node

查看:75
本文介绍了使用HTML agility pack选择节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

从下面的链接我想找回'找到的16个订单项。'¥

From the below link I am trying to return '16 line items found.'

http://www.netcomponents.com/results.htm?t=f&r=1&pn1=12345J

http://www.netcomponents.com/results.htm?t=f&r=1&pn1=12345J

我的代码到目前为止,它保持返回0结果..

My code so far is below, it keeps returning 0 results..

  	    HtmlWeb NC = new HtmlWeb();
            HtmlAgilityPack.HtmlDocument doc = NC.Load(NetComsURL.NetComURL);
            HtmlNodeCollection NetlinkNodes = doc.DocumentNode.SelectNodes("//div[@ID=\"livesearch\"]");

            if (NetlinkNodes != null)
            {
                // Loop through the nodes in and grab the last one
                foreach (var node in NetlinkNodes)
                {

                    txtResult.text += node.InnerText;

                }

如果你在这里加载链接是源代码....

Incase you cannot load the link here is the source code....

<tr><td colspan="2"></td></tr></table></td><TD ALIGN=CENTER VALIGN=MIDDLE NOWRAP WIDTH=100% >&nbsp;<div ID="livesearch" style="display:none;;background: infobackground;"></div>16 line items found.</td> 

非常感谢,

Dean

推荐答案

任何人?


这篇关于使用HTML agility pack选择节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆