简体   繁体   English

C#Win8 HtmlAgilityPack问题

[英]c# win8 HtmlAgilityPack trouble

Hello I want to parse HTML from a website for metro app. 您好,我想从Metro应用程序的网站解析HTML。 I saw some tutorials about HtmlAgilityPack and I decided that it is kinda easily. 我看了一些有关HtmlAgilityPack的教程,我认为这很容易。 But when I started project, I saw that some methods or references are not included in HtmlAgilityPack library as tutorials I watched. 但是当我开始项目时,我看到一些HtmlAgilityPack库中没有包含一些方法或引用,就像我观看的教程一样。

Example : 范例:

in the tutorial video, it says: 在教程视频中,它说:

HtmlWeb web = new HtmlWeb(); HtmlWeb web =新的HtmlWeb();

HtmlDocument doc = web.Load("url"); HtmlDocument doc = web.Load(“ url”);

in my HtmlAgilityPack library, I can't see a method called HtmlWeb.Load 在我的HtmlAgilityPack库中,看不到称为HtmlWeb.Load的方法

Example 2 : 范例2:

in tutorial video, it says : 在教学视频中,它说:

var res = doc.DocumentNode.SelectNodes("element names"); var res = doc.DocumentNode.SelectNodes(“元素名称”);

in my library, there isn't a method called "SelectNodes" in HtmlDocument.DocumentNode 在我的库中,HtmlDocument.DocumentNode中没有名为“ SelectNodes”的方法

Am I missing something? 我想念什么吗? I installed HtmlAgilityPack in NuGet. 我在NuGet中安装了HtmlAgilityPack。

No, you missed nothing. 不,您什么都没错过。 The metro (Windows RT) platform doesn't support all of Windows .NET features. Metro(Windows RT)平台不支持所有Windows .NET功能。

XPATH for example is not supported, and since the XPATH feature (SelectNodes comes with this feature) of Html Agility Pack is based on the .NET one, it's not supported in Html Agility Pack for Windows RT. 例如,不支持XPATH,并且由于HTML Agility Pack的XPATH功能(SelectNodes随附此功能)基于.NET,因此Windows RT Html Agility Pack不支持该功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM