AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.1" />

 ApiExtensions

public static class ApiExtensions
A set of useful extension methods when dealing with the DOM.
public static IEnumerable<TNode> Ancestors<TNode>(this INode child) where TNode : INode

Gets the ancestor nodes of the given child.

public static Task<Event> AwaitEvent<TEventTarget>(this TEventTarget node, string eventName) where TEventTarget : IEventTarget

Returns a task that is completed once the event is fired.

public static TElement CreateElement<TElement>(this IDocument document) where TElement : IElement

Creates an element of the given type or returns null, if there is no such type.

public static IEnumerable<TNode> Descendents<TNode>(this INode parent) where TNode : INode

Gets the descendent nodes of the given parent.

public static ICssStyleSheet GetCss(this Uri uri, IConfiguration configuration = null)

Uses the URL to download the content, parse it as CSS and returning a new CSSStyleSheet with the CSS-OM representation.

public static Task<ICssStyleSheet> GetCssAsync(this Uri uri, IConfiguration configuration = null)

Uses the URL to download the content asynchronously, parse it as CSS and returning a new CSSStyleSheet with the CSS-OM representation.

public static Task<ICssStyleSheet> GetCssAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null)

Uses the URL to download the content asynchronously, parse it as CSS and returning a new CSSStyleSheet with the CSS-OM representation.

public static IDocument GetHtml(this Uri uri, IConfiguration configuration = null)

Uses the URL to download the content, parse it as HTML and returning a new HTMLDocument with the DOM representation.

public static Task<IDocument> GetHtmlAsync(this Uri uri, IConfiguration configuration = null)

Uses the URL to download the content asynchronously, parse it as HTML and returning a new HTMLDocument with the DOM representation.

public static Task<IDocument> GetHtmlAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null)

Uses the URL to download the content asynchronously, parse it as HTML and returning a new HTMLDocument with the DOM representation.

public static ICssStyleSheet ParseCss(this string content, IConfiguration configuration = null)

Interprets the string as CSS source code and returns new CSSStyleSheet with the CSS-OM representation.

public static IDocument ParseHtml(this string content, IConfiguration configuration = null)

Interprets the string as HTML source code and returns new HTMLDocument with the DOM representation.