HtmlAgilityPack和Windows 8 WinRT [英] HtmlAgilityPack and windows 8 winRT

查看:84
本文介绍了HtmlAgilityPack和Windows 8 WinRT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Windows 8构建Metro应用程序.在此应用程序中,我试图解析网站中的数据.为此,我正在使用HtmlAgilityPack 1.4.6.但是我对"Dose HAP 1.4.6在Windows 8上可以使用吗?"感到非常困惑.和它是否支持Xpath?" Codeplex上太多令人困惑的信息.到目前为止,它似乎可以在Windows 8上运行,但是我看不到HtmlNode.SelectNode方法.如果Xpath不起作用,是否还有其他选项可以进行解析?您可以指导我学习教程或示例吗?请...

I'm trying to build a metro app for windows 8. In this app i'm trying to parse data from a website. For that i'm using HtmlAgilityPack 1.4.6. BUT i'm getting really confused about 'Dose HAP 1.4.6 works with windows 8?' and 'Dose it support Xpath?' Too much confusing info on Codeplex. As for now it seems that it works on windows 8 BUT i can't see HtmlNode.SelectNode method. If Xpath is not working, is there any other option to do the parsing? Can you direct me to a tutorial or examples? please...

您的

推荐答案

您可以使用LINQ API:

You can use the LINQ API:

var doc = new HtmlDocument();
doc.LoadHtml(contents);
var programmes = doc.DocumentNode.Descendants().Where(d => d.GetAttributeValue("class", "") == "program")

很遗憾,我找不到有关此API的最新信息.

Unfortunately, I couldn't find much up-to-date information on this API.

这篇关于HtmlAgilityPack和Windows 8 WinRT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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