z3l.FastHtmlParser 1.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package z3l.FastHtmlParser --version 1.8.0
                    
NuGet\Install-Package z3l.FastHtmlParser -Version 1.8.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="z3l.FastHtmlParser" Version="1.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="z3l.FastHtmlParser" Version="1.8.0" />
                    
Directory.Packages.props
<PackageReference Include="z3l.FastHtmlParser" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add z3l.FastHtmlParser --version 1.8.0
                    
#r "nuget: z3l.FastHtmlParser, 1.8.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package z3l.FastHtmlParser@1.8.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=z3l.FastHtmlParser&version=1.8.0
                    
Install as a Cake Addin
#tool nuget:?package=z3l.FastHtmlParser&version=1.8.0
                    
Install as a Cake Tool

z3l.FastHtmlParser

Fast, low-allocation HTML / XML parser for scraping and data extraction on .NET 9, .NET 10 and .NET 11.

Website: https://fasthtmlparser.com (try it on any page) · NuGet: https://www.nuget.org/packages/z3l.FastHtmlParser

  • Fast parsing. About 10x faster than HtmlAgilityPack and AngleSharp on typical pages, up to 30x on large ones, with 12–23x less memory (see the benchmarks); a 50 KB page parses in about 60 μs with a single exact-size list of tags.
  • No allocations when you match tags or attributes. Use HtmlTag / HtmlAttribute enums (about 250 values each: HTML, SVG, MathML, RSS, Atom, sitemap) or plain strings.
  • HTML5 entities. All 2125 named references, legacy names without ;, numeric references — decoded the way browsers do.
  • Text extraction. Text() gives the visible text in one line, as jsoup's text(): <br>, blocks and table cells separate words (Price<br>100, <td>Price</td><td>100</td> → Price 100); TextLineBreaks() keeps the visible line structure (<br>, <p>, <li>, <div>...).
  • HTML to Markdown. Markdown() gives a page or any tag as Markdown: headings, lists, links, tables, code blocks. 10–20x faster than ReverseMarkdown and Html2Markdown on typical pages, with 37–62x less memory.
  • Article extraction. Article() finds the main content of a page by the method of Mozilla's Readability: title, author, date, image and the article without menus, sidebars and comments, as clean HTML, Markdown or text.
  • HTML sanitizer. Sanitize() keeps only the allowed tags, attributes, URL schemes and CSS of untrusted HTML, written anew so that a browser reads it as written: no scripts, event handlers or javascript: links.
  • XPath 1.0. doc.XPath("//div[@class='card']/a"), doc.XPathValues("//a/@href"), compiled and cached.
  • CSS selectors. doc.Css("div.card > a[href^='/item']"), :nth-child(), :not(), :has(), compiled and cached.
  • Forms. form.Fields() gives the fields a browser would send (hidden __VIEWSTATE, checked boxes, selected options), ready for FormUrlEncodedContent.
  • Parse from buffers. HtmlParser.Parse(memory) reads a char[] or a pooled buffer in place, without a copy.
  • Null-safe chains. Every method accepts null and returns null / empty, so a chain never throws when something is missing.
  • Thread-safe reads. A parsed document is read-only; query it from any number of threads.

Install

dotnet add package z3l.FastHtmlParser

Quick start

using z3l.FastHtmlParser;

var doc = new HtmlParser(html, "https://example.com/catalog/");

// first match
var title = doc.Find(HtmlTag.H1).Text();
var price = doc.Find(HtmlTag.Span, cls: "price").Text();

// chains never throw: a missing tag gives null at the end
var phone = doc.Find(HtmlTag.Div, id: "contacts")
               .Find(HtmlTag.A, cls: "phone")
               .AttributeHrefTelephone();

// all matches; links are made absolute against the page URL
foreach (var a in doc.Find(HtmlTag.Div, cls: "gallery").FindAll(HtmlTag.A))
{
    Console.WriteLine(a.AttributeHref());
}

Finding tags

Find returns the first match, FindAll all matches (lazily), Is checks one tag. They work on the whole document or inside a tag (tag.Find(...) searches its descendants).

doc.Find(HtmlTag.Table);
doc.Find(HtmlTag.Li, cls: "item");                        // one of the space-separated classes
doc.Find(HtmlTag.Div, id: "main");
doc.Find(HtmlTag.Dt, text: "Price");                      // visible text: tags removed, entities decoded
doc.Find("custom-element");                               // names that are not in HtmlTag

// any combination of criteria
doc.Find(new TagQuery(HtmlTag.Meta) { Attribute = HtmlAttribute.Property, AttributeValue = "og:title" });
doc.FindAll(new TagQuery(HtmlTag.Img) { AttributeName = "data-lazy", AttributeValue = "true" });
doc.Find(new TagQuery { IdStartsWith = "product-" });     // any tag
tag.Is(new TagQuery(HtmlTag.Li) { Class = "item", TextStartsWith = "Price" });

TagQuery criteria: Class, Id, IdStartsWith, Attribute / AttributeName + AttributeValue, Text, TextStartsWith, Body, BodyStartsWith, Source. Null criteria are not checked. A query is a struct: searching allocates nothing, and the name is compared first with one integer comparison.

using z3l.FastHtmlParser.Shortcuts;

doc.FindByNameClass(HtmlTag.Span, "price");
doc.FindByNameText(HtmlTag.Dt, "Price").NextSiblingByName(HtmlTag.Dd).Text();
doc.FindAllByNameAttribute(HtmlTag.Img, HtmlAttribute.DataSrc, "...");
doc.FindByNameItemprop(HtmlTag.Span, "price");
tag.IsNameClass(HtmlTag.Div, "card");
tag.ParentByName(HtmlTag.Table);
tag.AttributeTitle();

Every shortcut is a one-line call of the core API above; they live in their own namespace, so the core API stays small unless you import them.

Reading a tag

tag.Name;              // "div"
tag.Text();            // visible text in one line, entities decoded: "a<br>b" → "a b", "a<b>b</b>" → "ab"
tag.TextLineBreaks();  // text with line breaks: <br>, block elements → new line, <p> → paragraph
tag.Body();            // inner HTML
tag.FullSource();      // outer HTML
tag.AttributeHref();   // absolute URL
tag.AttributeByName(HtmlAttribute.Content);   // decoded value
tag.AttributeBody(HtmlAttribute.Content);     // value as written in the source

foreach (var (name, value) in tag.Attributes()) { }   // all attributes: lower-case names, decoded values

Forms

Form() gives the form of a tag (the <form> itself or the form a control belongs to), Forms() all forms of the page. Fields() returns what a browser sends when the form is submitted.

var form = doc.Find(HtmlTag.Form, id: "form1").Form();

form.Action;   // absolute URL
form.Method;   // "get" / "post"
form.Fields(); // [("__VIEWSTATE", "..."), ("__EVENTVALIDATION", "..."), ("txtSearch", "phone")]

// an ASP.NET postback: send the clicked button too
var button = doc.Find(new TagQuery(HtmlTag.Input) { AttributeName = "name", AttributeValue = "btnSearch" });
var content = new FormUrlEncodedContent(form.Fields(button));

As in a browser: controls without a name and disabled ones (also inside <fieldset disabled>) are left out, a checkbox or radio button is sent only when checked (with its value or on), a select sends its selected option or the first enabled one, an option without value sends its text, a textarea its text, controls outside the form with form="id" belong to it, and submit buttons are sent only as the submitter. File inputs are left out.

tag.Parent();
tag.Parent(HtmlTag.Table);                            // nearest enclosing <table>
tag.Parent(new TagQuery(HtmlTag.Div) { Class = "card" });
tag.Children();                                       // direct children
foreach (var descendant in tag) { }                   // all tags inside
tag.NextSibling();
tag.NextSibling(HtmlTag.Dd);                          // <dt>Price</dt><dd>100</dd>
tag.PreviousSibling();
tag.Next(HtmlTag.Div);                                // first <div> after this tag

Wherever a TagQuery is expected, a plain HtmlTag or a tag name works too: it means "a tag with this name" (tag.NextSibling(HtmlTag.Dd), tag.NextSibling("dd"), tag.Parent("my-widget")).

Example: a definition list.

var price = doc.Find(HtmlTag.Dt, text: "Price").NextSibling(HtmlTag.Dd).Text();

XPath

XPath 1.0 works on the document or inside a tag. XPath returns tags, XPathValues / XPathValue return values: decoded attributes, text(), the visible text of tags, or the result of count(), sum(), string()...

doc.XPath("//div[@class='card']//span[@class='price']");
doc.XPathFirst("//ul[@id='menu']/li[last()]/a");
doc.XPathValues("//a[contains(@href, '/product/')]/@href");
doc.XPathValue("//dt[.='Price']/following-sibling::dd[1]");
doc.XPathValue("count(//table//tr)");                       // "12"

var card = doc.XPathFirst("//div[@id='main']");
card.XPath(".//a");                                         // relative paths start at the tag
card.XPath("//a");                                          // '/' and '//' search the whole document

// compile once, reuse on any number of pages and threads
static readonly XPathQuery Titles = XPathQuery.Compile("//article//h3/a/@title");
page.XPathValues(Titles);

All axes (except namespace), predicates, |, operators and the XPath 1.0 functions are supported, plus ends-with(), lower-case() and upper-case(). HTML rules apply: names are case-insensitive, entities are decoded, and the string-value of an element is its Text() (one line: <br>, blocks and cells separate words, whitespace collapsed, script/style dropped; lxml and HtmlAgilityPack join the text nodes as they are). //name and [@attr='value'] run as a linear scan of the tag list with in-place attribute comparison. String expressions are compiled once and cached; an invalid expression throws ArgumentException with the position of the error.

CSS selectors

Css, CssFirst and IsCss work as querySelectorAll, querySelector and matches in a browser.

doc.Css("article.product_pod h3 > a");
doc.CssFirst("ul#menu > li:last-child a")?.AttributeHref();
doc.Css("table tr:nth-child(odd) > td:nth-child(2)");
doc.Css("div.quote:has(a.tag[href*=love]) span.text");
doc.Css("a[href$='.pdf' i]:not([rel~=nofollow])");
doc.Css("h2:contains('Price') + p");                        // the visible text contains the string

var list = doc.CssFirst("ul.menu");
list.Css("> li");                                           // its children
list.Css(":scope > li > a");
link.IsCss("nav a.active");

// compile once, reuse on any number of pages and threads
static readonly CssQuery Prices = CssQuery.Compile("div.card span.price");
page.Css(Prices);

Supported: type, *, #id, .class, attribute selectors ([a], =, ~=, |=, ^=, $=, *=, with the i / s flags), the four combinators, selector lists, :first-child, :last-child, :only-child, the -of-type variants, :nth-child(An+B [of S]), :nth-last-child(), :nth-of-type(), :nth-last-of-type(), :not(), :is(), :where(), :has(), :empty, :root, :scope, :link, :checked, :disabled, :enabled, :required, :optional, and the non-standard :contains(). Ids, classes and attribute values are case-sensitive as in a standards-mode page, except the values HTML compares ignoring case (type, rel, lang, ...). Results are cross-checked against AngleSharp. A simple selector runs as fast as FindAll; tag.Css("div a") matches the whole selector against the document, as in a browser, and returns the tags inside tag.

Markdown

Markdown() gives a page, or any part of it, as Markdown: for a language model, a search index, a note to keep.

var doc = new HtmlParser(html, "https://example.com/blog/post");

string page = doc.Markdown();                                // the whole page
string? article = doc.Find(HtmlTag.Article).Markdown();      // one part of it
string? specs = doc.CssFirst("table.specs").Markdown();      // "| Name | Value |\n| --- | --- |\n| ..."

// only the text and its structure: less to read for a language model
string? text = doc.Find(HtmlTag.Main).Markdown(new MarkdownOptions { Links = false, Images = false });

HtmlText.ToMarkdown("<h2>Title</h2><p>Some <b>bold</b> text</p>");   // "## Title\n\nSome **bold** text"
  • Headings, paragraphs, line breaks, emphasis, strikethrough, quotes, rules, nested lists (numbered from their start, task lists with checkboxes), definition lists, code spans, code blocks with their language (class="language-…"), links and images with their titles.
  • A table of data becomes a GitHub table: colspan and rowspan keep the columns in place, and a table without a heading row gets an empty one. A table that only lays out a page (a table inside it, a single column, role="presentation") is written as the blocks in its cells.
  • Only what a browser shows: head, script, style, noscript, template, comments, svg and form controls are left out.
  • Links and images are absolute when the document has a page URL, the same addresses as AttributeHref() gives. An image that a script loads on scroll is taken from data-src; a link without an address or with a script is written as its text.
  • Text gets a backslash only where Markdown would read it as its own: snake_case, 2 * 3, [1] and AT&T stay as they are; *text*, or a line that starts with #, - or 1., is escaped.
  • The Markdown renders as the page reads. Emphasis that Markdown would not take for emphasis (**Note:**text, 文**「字」**文) gets an empty comment next to it, two lists in a row get different markers, a link around several blocks becomes a link in each of them.
  • One pass over the parsed tags, no object per tag, linear time on any markup. Lines end with LF; the result has no line break at its start or end.

On every test page the Markdown, rendered back to HTML by Markdig, has the same text, links, images, headings and list items as the page itself (MarkdownCrossCheckTests).

books.toscrape.com, 51 KB: HTML → Markdown Mean Allocated
z3l.FastHtmlParser 114 μs 39 KB
Html2Markdown 1,751 μs (15x) 1,627 KB (42x)
ReverseMarkdown 2,195 μs (19x) 2,240 KB (58x)
html-to-markdown (a Rust library, through its .NET binding) 3,675 μs (32x) 122 KB (3x)

All four pages and what is compared: benchmarks/README.md.

The package z3l.FastHtmlParser.HtmlToMarkdown is for those who look for an HTML to Markdown converter: this library with one more method, HtmlToMarkdown.Convert(html, "https://example.com/blog/post"), which never returns null. With z3l.FastHtmlParser installed you do not need it; the two can be installed together. Try the converter on any page: https://htmltomarkdown.fasthtmlparser.com

Article extraction

Article() finds the main content of a page, by the method of Mozilla's Readability (the reader view of Firefox): the article without the menus, sidebars, comments, ads and footers around it.

var doc = new HtmlParser(html, "https://example.com/news/2026/11/foxes");

if (doc.IsProbablyReadable() && doc.Article() is { } article)    // the quick test passes over lists and search pages
{
    Console.WriteLine($"{article.Title} by {article.Byline}, {article.PublishedTime}");
    string markdown = article.Markdown;      // for a language model
    string clean = article.Content;          // clean HTML, safe to show
}
  • Title, Byline, Excerpt, SiteName, PublishedTime, Image from JSON-LD, Open Graph, Twitter and Dublin Core metadata, or from the page itself (<title> without the site name, a byline, the first paragraph); Language from <html lang>.
  • Content is the article as clean HTML, written by Sanitize(): paragraphs, headings, lists, tables of data, links, images (lazy ones from data-src) and code, absolute with the page URL; Markdown and TextContent are made from it.
  • The page is not changed: what Readability removes is marked in the tag list and the text is counted in one pass. On the 130 test pages of Mozilla Readability the text of the article matches the expected one at 0.99 (mean F1 by words), and 498 of 502 metadata fields are the same (ArticleTests).
Article of a page: HTML → title, metadata, text z3l.FastHtmlParser SmartReader (Readability on AngleSharp)
Ars Technica, 56 KB 255 μs, 152 KB 3,454 μs (14x), 2,439 KB (16x)
Medium, 120 KB 628 μs, 293 KB 7,005 μs (11x), 7,941 KB (27x)
Wikipedia, 244 KB 2,508 μs, 1,396 KB 48,513 μs (19x), 19,932 KB (14x)
New York Times, 309 KB 935 μs, 623 KB 15,569 μs (17x), 8,900 KB (14x)
The Guardian, 1.1 MB 824 μs, 430 KB 18,705 μs (23x), 17,081 KB (40x)

Pages from the test set of Mozilla Readability, .NET 10, Ryzen 7 3800X; ArticleBenchmarks in benchmarks.

The package z3l.FastHtmlParser.Readability is this library with one more class, Readability.Parse(html, url), for those who look for Readability by name.

Sanitizing HTML

Sanitize() makes untrusted HTML (comments, posts, e-mails, scraped pages) safe to put in a page.

string safe = HtmlText.Sanitize("<p onclick=\"steal()\">Hi <script>alert(1)</script></p>");   // "<p>Hi </p>"

var options = new SanitizeOptions { LinkRel = "nofollow noopener" };   // every link gets this rel
options.AllowedAttributes.Remove("style");
options.AllowedTags.Add("iframe");                                     // video embeds
string comment = new HtmlParser(html, "https://example.com/post/1").Sanitize(options);   // relative links made absolute
  • Only the allowed tags, attributes, URL schemes (http, https, mailto, tel, relative) and CSS properties with plain values are kept; every set of SanitizeOptions can be changed. A tag that is not allowed is left out and its text stays; script, style, form controls, frames and media go with their content.
  • Never kept, whatever the options say: event handlers, srcdoc, script, style, template, noscript, svg, math and the other tags whose content a browser does not read as HTML. Hidden schemes (JaVaScRiPt:, jav&#x09;ascript:, entities, control chars) are found; CSS with url(, expression or escapes is dropped.
  • The result is written anew: lower-case tags, attributes in double quotes, every text and value escaped, every element closed and the end tags a browser would imply written where it would imply them. On random broken markup AngleSharp (a parser that follows the HTML standard, as browsers do) finds only allowed elements and attributes in the result, and sanitizing it again changes nothing (SanitizerTests).
Sanitize with the default options z3l.FastHtmlParser HtmlSanitizer (Ganss.Xss, on AngleSharp)
A comment, 1 KB 7.6 μs, 3 KB 135 μs (18x), 115 KB (37x)
quotes.toscrape.com, 11 KB 67 μs, 32 KB 793 μs (12x), 698 KB (22x)
webscraper.io laptops, 38 KB 160 μs, 76 KB 1,623 μs (10x), 1,055 KB (14x)
books.toscrape.com, 51 KB 276 μs, 142 KB 2,263 μs (8x), 1,573 KB (11x)

.NET 10, Ryzen 7 3800X; SanitizeBenchmarks in benchmarks.

The package z3l.FastHtmlParser.HtmlSanitizer is this library with one more class, HtmlSanitizer.Sanitize(html, url, options).

Parsing from a buffer

Text that is already in a char[] or a pooled buffer can be parsed in place, without copying it into a string.

var doc = HtmlParser.Parse(chars.AsMemory(0, length), url);   // the buffer must not change while doc is used

// hand a pooled buffer over: Dispose returns it to the pool
var owner = MemoryPool<char>.Shared.Rent(maxChars);
int length = reader.Read(owner.Memory.Span);
using var page = HtmlParser.Parse(owner, length, url);

Everything works as with a string; PageSource makes the string on its first use.

Text helpers for raw HTML

HtmlText.Decode("Q&amp;A &copy; 2026");            // "Q&A © 2026"
HtmlText.ToText("<b>Hello</b>   world");           // "Hello world"
HtmlText.ToTextWithLineBreaks("<p>One</p><p>Two</p>");
HtmlText.ToMarkdown("<p>One <a href=\"/two\">two</a></p>");   // "One [two](/two)"
HtmlText.Sanitize("<b onclick=\"x()\">bold</b>");                // "<b>bold</b>"

Parsing rules

The parser builds a flat list of tags, not a full DOM, and follows the HTML rules that matter for scraping:

  • `` are single HtmlTag.Comment tags; markup inside them is ignored.
  • The content of script, style, textarea, title, iframe, xmp, noembed, noframes is text, not markup.
  • Void elements (img, br, meta, link, input, hr, ...) and <!doctype> never contain other tags.
  • Text(), IsText and TextLineBreaks() return the visible text: comments and the content of script, style, noscript, template, noframes, noembed are skipped (Text() of a <script> itself still gives its code). Text() is one line, as jsoup's text(): <br>, block elements (p, div, li, tr, h1...) and table cells separate words, inline tags (b, span, a) do not, whitespace and line breaks collapse to one space; inside <pre> whitespace is kept. Markdown() also leaves out head, svg and form controls.
  • Optional end tags work as in HTML5: a new <li> ends an open <li>, <td>/<tr> end open cells and rows, <dt>/<dd> and <option> end their open siblings, a block element (<div>, <ul>, <table>, ...) ends an open <p>.
  • Tags left open are ended by the end tag of an enclosing element (<li>one<li>two</ul>) or by the end of the document, so a truncated page keeps its text.
  • < starts a tag only before a letter, /, ! or ?: in a < b it is text. Stray end tags (x</span>) are not text.
  • Quoted attribute values may contain < and >, and text that looks like another attribute: in <a title="see id=5" id="real"> the id is real.
  • A document that starts with <?xml (RSS, Atom, sitemap, XHTML) is parsed by XML rules: an element is closed only by its end tag or />, so an RSS <link> keeps its content.
  • Attribute values are returned decoded, as a browser reads them (title="It&#39;s" → It's), and Is* / Find* compare decoded values. AttributeBody returns the value exactly as written. Links (AttributeHref, AttributeSrc) are decoded the same way (&amp; → &) and resolved against the page URL; percent-escapes are kept as written (%3F in a path is not a ?).
  • Nesting deeper than 512 levels is flattened, as in browsers: a deeper tag is found and has its text, but it does not become the parent of the tags inside it.
  • Parsing time grows linearly with the size of the page on any markup, including thousands of unclosed tags and stray end tags.

A document does not have to be disposed: it holds no unmanaged resources. Dispose() releases the source text and the tag list early (and returns a buffer handed over with HtmlParser.Parse(owner, length) to its pool); after it the document and its tags throw ObjectDisposedException.

On the test pages and on a set of broken-markup snippets (left-out end tags, stray end tags, truncated pages) the parser finds the same elements, texts, attribute values and parents as AngleSharp, apart from the trees a browser builds implicitly (an inserted <tbody>, an ignored second <body>).

Tests and benchmarks

dotnet test
dotnet run -c Release --project benchmarks/z3l.FastHtmlParser.Benchmarks -- --filter '*'

The tests run on saved pages of quotes.toscrape.com, books.toscrape.com and webscraper.io/test-sites and compare every page with AngleSharp, CSS selector results included. The benchmarks compare parsing and a complete scraping task with AngleSharp and HtmlAgilityPack; see benchmarks/README.md.

books.toscrape.com, 51 KB: parse + extract 20 books Mean Allocated
z3l.FastHtmlParser 69 μs 45 KB
z3l.FastHtmlParser, CSS selectors 75 μs (1.1x) 45 KB (1.0x)
z3l.FastHtmlParser, XPath 109 μs (1.6x) 173 KB (3.9x)
HtmlAgilityPack 760 μs (11x) 1,038 KB (23x)
AngleSharp 1,043 μs (15x) 707 KB (16x)

Other languages

The same parser is available for:

Language Package Source
C# (.NET 9, 10 and 11) z3l.FastHtmlParser on NuGet romanti3172/z3l.FastHtmlParser
Go github.com/romanti3172/fasthtmlparser romanti3172/fasthtmlparser
Rust fasthtmlparser on crates.io romanti3172/fasthtmlparser-rs
JavaScript / TypeScript z3l-fasthtmlparser on npm romanti3172/fasthtmlparser-js
Python fasthtmlparser on PyPI romanti3172/fasthtmlparser-py

License

Free for individuals and organizations with annual revenue below USD 1,000,000 and fewer than 100 employees, including commercial use. Organizations with annual revenue of USD 1,000,000 or more, or with 100 or more employees, need a commercial license: a one-time payment of USD 1,000 per organization, perpetual, all versions. The same license covers every z3l library, z3l.Scraper included: you pay once. See LICENSE.md for the full terms and pricing to buy a commercial license.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on z3l.FastHtmlParser:

Package Downloads
z3l.Scraper

Block-aware web scraping engine for .NET 9/10/11: request queue with priorities and de-duplication, retries with backoff, response checks (blocked, not found, cut-off pages), sessions of a client with its cookies, a user agent and an http/socks proxy (from a file, a URL or an API) kept while they do well, block policies for proxies and user agents, per-host throttling on 429/503, robots.txt, sitemaps, link depth, runs that resume after a crash, routing by page type or label with typed page data, async handlers and streamed results of any type. HTML is parsed with z3l.FastHtmlParser.

z3l.FastHtmlParser.HtmlToMarkdown

Fast HTML to Markdown converter for .NET 9/10/11, built on z3l.FastHtmlParser: 10–20x faster than ReverseMarkdown and Html2Markdown on typical pages, with 37–62x less memory. Headings, nested lists, links and images (absolute with a page URL), GitHub tables with colspan and rowspan, code blocks with their language, task lists, quotes. Text is escaped only where Markdown needs it; linear time on any markup.

z3l.FastHtmlParser.HtmlSanitizer

Fast HTML sanitizer for .NET 9/10/11 against XSS, built on z3l.FastHtmlParser: keeps only the allowed tags, attributes, URL schemes and CSS properties of untrusted HTML (comments, posts, e-mails, scraped pages) and writes the result anew, with every text and attribute escaped and every element closed. No AngleSharp dependency; linear time on any markup.

z3l.FastHtmlParser.Readability

Fast main-content extraction for .NET 9/10/11 by the method of Mozilla Readability (the reader view of Firefox), built on z3l.FastHtmlParser: the article of a page without menus, sidebars, comments, ads and footers, as clean HTML, Markdown or text, with its title, author, date, excerpt, site name and image (JSON-LD, Open Graph, Twitter, Dublin Core). The content is sanitized. Checked against the 130 test pages of Mozilla Readability.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.2 164 11/24/2026
1.8.1 144 11/22/2026
1.8.0 160 11/22/2026
1.7.0 114 11/22/2026
1.6.1 121 11/21/2026
1.5.0 137 11/20/2026
1.4.2 133 11/19/2026
1.4.1 1,335 11/17/2026
1.4.0 188 11/16/2026
1.3.0 128 11/15/2026
1.2.0 114 11/13/2026
1.1.4 107 11/13/2026
1.1.3 93 11/13/2026
1.1.2 101 11/10/2026
1.1.1 101 11/8/2026
1.1.0 104 11/7/2026
1.0.0 98 11/7/2026
0.1.0 95 11/7/2026