Defuddle 0.1.0

dotnet add package Defuddle --version 0.1.0
                    
NuGet\Install-Package Defuddle -Version 0.1.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="Defuddle" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Defuddle" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Defuddle" />
                    
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 Defuddle --version 0.1.0
                    
#r "nuget: Defuddle, 0.1.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 Defuddle@0.1.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=Defuddle&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Defuddle&version=0.1.0
                    
Install as a Cake Tool

Defuddle for .NET

NuGet

Get the main content of any page as clean HTML or Markdown, in C#.

It is an unofficial community port of defuddle by Steph Ango (@kepano). It ports upstream 0.19.13. Defuddle finds the main content of a web page and removes clutter such as comments, sidebars, headers, and footers.

To learn more, read the documentation.

Preview the docs site locally:

cd docs-site && npm ci && npm run api && npm run dev

Open http://localhost:4321/defuddle-dotnet/ . That URL is the marketing page. Documentation starts at http://localhost:4321/defuddle-dotnet/docs/ . Article sources stay in docs/articles/. See docs-site/README.md.

Installation

The package targets net10.0 and netstandard2.0. Run dotnet add package Defuddle.

Usage

Parsing HTML

<a id='snippet-parse-html'></a>

var result = DefuddleParser.ParseHtml(
    html,
    new DefuddleOptions { Url = "https://example.com/blog/tide-pools" }
);

Console.WriteLine(result.Content);

<sup><a href='/examples/Quickstart/Program.cs#L26-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-parse-html' title='Start of snippet'>anchor</a></sup>

Reading metadata

<a id='snippet-metadata'></a>

Console.WriteLine(result.Title);
Console.WriteLine(result.Author);
Console.WriteLine(result.Description);
Console.WriteLine(result.Domain);
Console.WriteLine(result.Language);
Console.WriteLine(result.WordCount);

<sup><a href='/examples/Quickstart/Program.cs#L35-L42' title='Snippet source file'>snippet source</a> | <a href='#snippet-metadata' title='Start of snippet'>anchor</a></sup>

See Response and metadata for every property.

Getting Markdown

<a id='snippet-markdown-option'></a>

var result = DefuddleParser.ParseHtml(
    html,
    new DefuddleOptions { Url = "https://example.com/blog/tide-pools", Markdown = true }
);

Console.WriteLine(result.Content); // Markdown

<sup><a href='/examples/Markdown/Program.cs#L26-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-markdown-option' title='Start of snippet'>anchor</a></sup>

Parsing an AngleSharp document

<a id='snippet-parse-document'></a>

var context = BrowsingContext.New(Configuration.Default);
var document = await context.OpenAsync(request =>
    request.Content(html).Address("https://example.com/blog/tide-pools")
);

var parser = new DefuddleParser(
    document,
    new DefuddleOptions { Url = "https://example.com/blog/tide-pools" }
);
var result = parser.Parse();

Console.WriteLine(result.Title);
Console.WriteLine(result.Content);

<sup><a href='/examples/AngleSharpDocument/Program.cs#L27-L41' title='Snippet source file'>snippet source</a> | <a href='#snippet-parse-document' title='Start of snippet'>anchor</a></sup>

Parsing a URL

<a id='snippet-fetch-url'></a>

using var http = new HttpClient();
var html = await http.GetStringAsync(url);

var result = await DefuddleParser.ParseHtmlAsync(
    html,
    new DefuddleOptions
    {
        Url = url,
        Markdown = true,
        HttpClient = http,
    }
);

Console.WriteLine(result.Title);
Console.WriteLine(result.Content);

<sup><a href='/examples/FetchUrl/Program.cs#L9-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-fetch-url' title='Start of snippet'>anchor</a></sup>

Debugging

<a id='snippet-debug-mode'></a>

var result = DefuddleParser.ParseHtml(html, new DefuddleOptions { Debug = true });

if (result.Debug is { } debug)
{
    Console.WriteLine(debug.ContentSelector);
    foreach (var removal in debug.Removals)
    {
        Console.WriteLine($"{removal.Step}: {removal.Reason} {removal.Selector}");
    }
}

<sup><a href='/examples/Debugging/Program.cs#L26-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-debug-mode' title='Start of snippet'>anchor</a></sup>

See Debugging and Options.

Site extractors

Pages from sites such as GitHub, Reddit, Hacker News, YouTube, Wikipedia, and X have their own extractors, picked from the URL. See Site extractors.

CLI

dotnet tool install -g Defuddle.Cli
defuddle parse https://example.com/article --markdown
curl -L https://stephango.com/saw | defuddle parse --json

The tool needs the .NET 10 runtime. It parses a file, a URL, or HTML on standard input. See CLI for every option.

Coming from JavaScript

Migrating from upstream maps the JavaScript names to the C# ones.

Contributing

See CONTRIBUTING.md.

License

MIT. Defuddle is Copyright (c) 2025 Steph Ango (@kepano). The .NET port is Copyright (c) 2026 Darío Kondratiuk. See LICENSE and NOTICE.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 0 12/3/2026