c# - 使用 C#、XAML 为 Windows 8 Metro 风格应用程序解析 html

标签 c# xaml windows-8 microsoft-metro

我的应用程序应该解析 html 并将内容加载到列表框中。我可以通过 webclient 获取 html,但无法解析它。
我听说过 Htmlagilitypack 和 Fizzler,但找不到任何关于它们使用的教程或示例。

我需要一些帮助,以便从如下所示的 html 文档中将“first_content”和“second_content”抓取到列表框中。

<html>
<body> 
<div>
<section>
<article>
   <header> 
       <hgroup> 
           <h1> 
              first_content
           </h1>
       </hgroup>
   </header> 
   <ul> 
        <li> 
           second_content
        </li>
   </ul>
</article> 
</section>
</div>
</body>
</html>

最佳答案

HtmlAgilityPack 是必经之路,我一直在 WCF、Windows Phone 和现在的 WinRt 中使用它并取得了圆满成功,用于教程检查 this blog post

关于c# - 使用 C#、XAML 为 Windows 8 Metro 风格应用程序解析 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14756076/

相关文章:

c# - 向类型 'System.Windows.Controls.ItemCollection' 的集合添加值引发异常

c# - 更改 Windows 8 中默认磁贴的形状

javascript - 在 Windows Metro javascript 应用程序中读取文件

c# - 拦截具有深继承树的对象

c# - 忽略毫秒的 LINQ DateTime 查询

c# - 如何在另一个包含 C# 列表的类类型列表中添加元素

python - Windows 8 不兼容?

c# - 如何从特定文件夹中获取未读邮件

c# - 尝试引用用户控件时出现错误 "The name does not exist in the current context"

.net - 在 WP8 上,我应该为 MultiBinding 类引用哪个程序集