Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Html Agility Pack (HAP) is a free, open-source .NET HTML parser that reads and writes the DOM and supports XPATH and XSLT.
Html Agility Pack (HAP) is a free, open-source .NET code library for parsing real-world, malformed HTML into a read/write DOM, with plain XPATH and XSLT support.
Html Agility Pack is a .NET code library that reads HTML files or streams and exposes them as a read/write DOM, similar to the System.Xml object model but designed for HTML. It accepts malformed, "out of the web" HTML that strict XML parsers reject, and lets .NET developers query and manipulate it with XPATH or XSLT. The library is written in C#, maintained by ZZZ Projects, and distributed as a NuGet package with over 2,800 GitHub stars according to the repository metadata.
Install-Package HtmlAgilityPack or the .NET CLI with dotnet add package HtmlAgilityPack.Yes, Html Agility Pack is free and open source. The project is sponsored by ZZZ Projects, which sells commercial libraries like Entity Framework Extensions and Dapper Plus to fund development, but the parser itself has no license fee.
You can install it via NuGet. In the Visual Studio Package Manager Console run Install-Package HtmlAgilityPack, or in a .NET project run dotnet add package HtmlAgilityPack.
It parses HTML from a file, string, or stream into a DOM, then lets you navigate, query, and edit it using XPATH or XSLT. Because it tolerates malformed HTML, it is suited for scraping real-world web pages.
Yes, the library supports plain XPATH queries on the parsed HTML DOM. It also supports XSLT for transforming documents, so you can query or reshape HTML without writing the parser logic yourself.
It is a .NET code library written in C#, distributed as a NuGet package. The repository page does not enumerate specific target frameworks, but the package is available through the standard NuGet gallery.
