c# - 在 C# 中解析 html 的最佳方法是什么?

标签 c# .net html parsing html-content-extraction

<分区>

我正在寻找一个库/方法来解析一个 html 文件,它比通用的 xml 解析库具有更多特定于 html 的特性。

最佳答案

Html Agility Pack

This is an agile HTML parser that builds a read/write DOM and supports plain XPATH or XSLT (you actually don't HAVE to understand XPATH nor XSLT to use it, don't worry...). It is a .NET code library that allows you to parse "out of the web" HTML files. The parser is very tolerant with "real world" malformed HTML. The object model is very similar to what proposes System.Xml, but for HTML documents (or streams).

关于c# - 在 C# 中解析 html 的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56107/

相关文章:

c# - 我什么时候需要 Windows SDK 以及 .NET 的用途是什么?

c# - 如何禁止编辑文本框?

c# - Bitmap.LockBits "pin"位图是否存入内存?

c# - 调用 BeginAcceptTcpClient 后停止 TcpListener

html - 电子邮件模板 HTML 图像未出现在 gmail 中

javascript - HTML5 将常用属性组合成超属性?

css - 字体 :size not working in ipad for Html table

c# - 更改模型 MVC 上的属性类型

.net - LDAP 查询返回组中的所有用户

c# - 单个实例并在系统托盘中通知