C# Class OnlineVideos.Sites.JSurf.Extensions.HtmlAgilityPackExtensions

Extension methods for htmlagilitypack
ファイルを表示 Open project: offbyoneBB/mp-onlinevideos2

Public Methods

Method Description
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

Method Details

FindAllChildElements() public static method

Find the first child which is a html element (not text or script blocks)
public static FindAllChildElements ( this node ) : List
node this
return List

FindFirstChildElement() public static method

Find the first child which is a html element (not text)
public static FindFirstChildElement ( this node ) : HtmlNode
node this
return HtmlAgilityPack.HtmlNode

GetAttribute() public static method

Get a node attribute
public static GetAttribute ( this node, string attributeName ) : string
node this
attributeName string
return string

GetElementById() public static method

Select all elements with the specified id
public static GetElementById ( this document, string id ) : HtmlNode
document this
id string
return HtmlAgilityPack.HtmlNode

GetElementsByTagName() public static method

Select all elements with the specified tag
public static GetElementsByTagName ( this document, string tagName ) : HtmlAgilityPack.HtmlNodeCollection
document this
tagName string
return HtmlAgilityPack.HtmlNodeCollection

GetInnerText() public static method

Get the innertext of the node, or an empty string if null
public static GetInnerText ( this node ) : string
node this
return string

GetInnerTextTrim() public static method

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
return string

GetNodeByClass() public static method

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)
return HtmlAgilityPack.HtmlNode

GetNodesByClass() public static method

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)
return List

NavigatePath() public static method

Navigate down a path using the position of child elements
public static NavigatePath ( this node, int childPositions ) : HtmlNode
node this
childPositions int
return HtmlAgilityPack.HtmlNode