C# Класс OnlineVideos.Sites.JSurf.Extensions.HtmlAgilityPackExtensions

Extension methods for htmlagilitypack
Показать файл Открыть проект

Открытые методы

Метод Описание
FindAllChildElements ( this node ) : List

Find the first child which is a html element (not text or script blocks)

FindFirstChildElement ( this node ) : HtmlNode

Find the first child which is a html element (not text)

GetAttribute ( this node, string attributeName ) : string

Get a node attribute

GetElementById ( this document, string id ) : HtmlNode

Select all elements with the specified id

GetElementsByTagName ( this document, string tagName ) : HtmlAgilityPack.HtmlNodeCollection

Select all elements with the specified tag

GetInnerText ( this node ) : string

Get the innertext of the node, or an empty string if null

GetInnerTextTrim ( this node ) : string

Get the innertext of the node, or an empty string if null. Result will be cleared from newlines and trimmed by spaces.

GetNodeByClass ( this node, string className, bool allowPartialMatch = false ) : HtmlNode

Find the first descendent node which has the specified class

GetNodesByClass ( this node, string className, bool allowPartialMatch = false ) : List

Find all nodes matching a class

NavigatePath ( this node, int childPositions ) : HtmlNode

Navigate down a path using the position of child elements

Описание методов

FindAllChildElements() публичный статический Метод

Find the first child which is a html element (not text or script blocks)
public static FindAllChildElements ( this node ) : List
node this
Результат List

FindFirstChildElement() публичный статический Метод

Find the first child which is a html element (not text)
public static FindFirstChildElement ( this node ) : HtmlNode
node this
Результат HtmlAgilityPack.HtmlNode

GetAttribute() публичный статический Метод

Get a node attribute
public static GetAttribute ( this node, string attributeName ) : string
node this
attributeName string
Результат string

GetElementById() публичный статический Метод

Select all elements with the specified id
public static GetElementById ( this document, string id ) : HtmlNode
document this
id string
Результат HtmlAgilityPack.HtmlNode

GetElementsByTagName() публичный статический Метод

Select all elements with the specified tag
public static GetElementsByTagName ( this document, string tagName ) : HtmlAgilityPack.HtmlNodeCollection
document this
tagName string
Результат HtmlAgilityPack.HtmlNodeCollection

GetInnerText() публичный статический Метод

Get the innertext of the node, or an empty string if null
public static GetInnerText ( this node ) : string
node this
Результат string

GetInnerTextTrim() публичный статический Метод

Get the innertext of the node, or an empty string if null. Result will be cleared from newlines and trimmed by spaces.
public static GetInnerTextTrim ( this node ) : string
node this
Результат string

GetNodeByClass() публичный статический Метод

Find the first descendent node which has the specified class
public static GetNodeByClass ( this node, string className, bool allowPartialMatch = false ) : HtmlNode
node this
className string
allowPartialMatch bool if true, also partial class names will be matched (no trailing/leading space)
Результат HtmlAgilityPack.HtmlNode

GetNodesByClass() публичный статический Метод

Find all nodes matching a class
public static GetNodesByClass ( this node, string className, bool allowPartialMatch = false ) : List
node this
className string
allowPartialMatch bool if true, also partial class names will be matched (no trailing/leading space)
Результат List

NavigatePath() публичный статический Метод

Navigate down a path using the position of child elements
public static NavigatePath ( this node, int childPositions ) : HtmlNode
node this
childPositions int
Результат HtmlAgilityPack.HtmlNode