如何使用htmlagilitypack报废xml文件 [英] How to scrap xml file using htmlagilitypack

查看:180
本文介绍了如何使用htmlagilitypack报废xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从报废 http://feeds.feedburner.com/Torrentfreak 一个XML文件,其链接和说明。

I need to scrap an xml file from http://feeds.feedburner.com/Torrentfreak for its links and description.

我用这个code:

    var webGet = new HtmlWeb();
                var document = webGet.Load("http://feeds.feedburner.com/TechCrunch");
    var TechCrunch = from info in document.DocumentNode.SelectNodes("//channel")
                                 from link in info.SelectNodes("//guid[@isPermaLink='false']")
                                 from content in info.SelectNodes("//description")
     select new
                                 {
                                     LinkURL = info.InnerText,
                                     Content = content.InnerText,

                                 };
lvLinks.DataSource = TechCrunch;
            lvLinks.DataBind(); 

我在列表视图控件使用它来显示asp.net页面上。
使用

I have used this in list view control to show on asp.net page. using

<%# Eval("LinkURL") %>  -  <%# Eval("Text") %> 

但其示值误差

值不能为空。
参数名:源

出了什么问题?并且有可能使用HtmlAgilityPack报废(读取)XML节点的数据?
请建议
谢谢

what's the problem ? And is it possible to scrap (fetch) xml nodes data using HtmlAgilityPack ? Please suggest Thanks

推荐答案

尝试使用RSS库,而不是HtmlAgilityPack的:

Try using RSS library instead of the HtmlAgilityPack:

下面有一些链接,可以帮助你:

Here are some links that might help you:

  • http://www.rssdotnet.com/
  • http://www.yetanotherchris.me/home/2010/2/8/simplified-c-atom-and-rss-feed-parser.html

这篇关于如何使用htmlagilitypack报废xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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