Table of Contents

Class HtmlDocumentS

Namespace
SunamoHtml.Html
Assembly
SunamoHtml.dll

Static helper class for loading and working with HTML documents using HtmlAgilityPack.

public static class HtmlDocumentS
Inheritance
HtmlDocumentS
Inherited Members

Methods

InnerHtmlToStringEmpty(HtmlNode?)

Gets the trimmed inner HTML of a node, or empty string if node is null.

public static string InnerHtmlToStringEmpty(HtmlNode? htmlNode)

Parameters

htmlNode HtmlNode

The HTML node to get inner HTML from.

Returns

string

Trimmed inner HTML, or empty string if node is null.

Load(string)

Loads HTML from a file and returns the document node. HTML is automatically decoded after loading from file.

public static Task<HtmlNode> Load(string path)

Parameters

path string

The file path to load HTML from.

Returns

Task<HtmlNode>

The document node of the loaded HTML.

LoadHtml(string)

Loads HTML from string and returns the document node. HTML is automatically decoded before loading.

public static HtmlNode LoadHtml(string html)

Parameters

html string

The HTML string to load.

Returns

HtmlNode

The document node of the loaded HTML.

Title(HtmlNode)

Extracts the title from an HTML document.

public static string Title(HtmlNode htmlNode)

Parameters

htmlNode HtmlNode

The HTML document node.

Returns

string

The title text, or empty string if not found.