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
htmlNodeHtmlNodeThe 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
pathstringThe file path to load HTML from.
Returns
LoadHtml(string)
Loads HTML from string and returns the document node. HTML is automatically decoded before loading.
public static HtmlNode LoadHtml(string html)
Parameters
htmlstringThe 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
htmlNodeHtmlNodeThe HTML document node.
Returns
- string
The title text, or empty string if not found.