F# Data


HtmlNode

Namespace: FSharp.Data

Module with operations on HTML nodes

Functions and values

Function or valueDescription
attribute name n
Signature: name:string -> n:HtmlNode -> HtmlAttribute

Returns the attribute with the given name. If the attribute does not exist then this will throw an exception Parameters: name - The name of the attribute to select n - The given node

attributes n
Signature: n:HtmlNode -> HtmlAttribute list

Gets all of the attributes of this node

attributeValue name n
Signature: name:string -> n:HtmlNode -> string

Return the value of the named attribute, or an empty string if not found. Parameters: name - The name of the attribute to get the value from n - The given node

descendants recurseOnMatch predicate n
Signature: recurseOnMatch:bool -> predicate:(HtmlNode -> bool) -> n:HtmlNode -> seq<HtmlNode>

Gets all of the descendants of this node that statisfy the given predicate Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements predicate - The predicate by which to match the nodes to return * n - The given node

descendantsAndSelf (...)
Signature: recurseOnMatch:bool -> predicate:(HtmlNode -> bool) -> n:HtmlNode -> seq<HtmlNode>

Gets all of the descendants of this node that statisfy the given predicate The current node is also considered in the comparison Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements predicate - The predicate by which to match the nodes to return * n - The given node

descendantsAndSelfNamed (...)
Signature: recurseOnMatch:bool -> names:seq<string> -> n:HtmlNode -> seq<HtmlNode>

Finds all of the descendant nodes of this nodes that match the given set of names The current node is also considered in the comparison Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements names - The set of names to match * n - The given node

descendantsAndSelfNamedWithPath (...)
Signature: recurseOnMatch:bool -> names:seq<string> -> n:HtmlNode -> seq<HtmlNode * HtmlNode list>

Finds all of the descendant nodes of this nodes that match the given set of names The current node is also considered in the comparison Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements names - The set of names to match * n - The given node

descendantsAndSelfWithPath (...)
Signature: recurseOnMatch:bool -> predicate:(HtmlNode -> bool) -> n:HtmlNode -> seq<HtmlNode * HtmlNode list>

Gets all of the descendants of this node that statisfy the given predicate The current node is also considered in the comparison Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements predicate - The predicate by which to match the nodes to return * n - The given node

descendantsNamed recurseOnMatch names n
Signature: recurseOnMatch:bool -> names:seq<string> -> n:HtmlNode -> seq<HtmlNode>

Finds all of the descendant nodes of this nodes that match the given set of names Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements names - The set of names to match * n - The given node

descendantsNamedWithPath (...)
Signature: recurseOnMatch:bool -> names:seq<string> -> n:HtmlNode -> seq<HtmlNode * HtmlNode list>

Finds all of the descendant nodes of this nodes that match the given set of names Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements names - The set of names to match * n - The given node

descendantsWithPath (...)
Signature: recurseOnMatch:bool -> predicate:(HtmlNode -> bool) -> n:HtmlNode -> seq<HtmlNode * HtmlNode list>

Gets all of the descendants of this node that statisfy the given predicate Parameters: recurseOnMatch - If a match is found continues down the tree matching child elements predicate - The predicate by which to match the nodes to return * n - The given node

directInnerText n
Signature: n:HtmlNode -> string

Returns the direct inner text of the current node Parameters: * n - The given node

elements n
Signature: n:HtmlNode -> HtmlNode list

Gets all of the nodes immediately under this node

elementsNamed names n
Signature: names:seq<string> -> n:HtmlNode -> HtmlNode list

Finds all of the elements nodes of this node that match the given set of names Parameters: names - The set of names to match n - The given node

hasAttribute name value n
Signature: name:string -> value:string -> n:HtmlNode -> bool

Returns true if the current node has an attribute that matches both the name and the value Parameters: name - The name of the attribute value - The value of the attribute * x - The given html node

hasClass cssClass n
Signature: cssClass:string -> n:HtmlNode -> bool

Returns true if the current node has the specified class

hasId id n
Signature: id:string -> n:HtmlNode -> bool

Returns true if the current node has the specified id

hasName expectedName n
Signature: expectedName:string -> n:HtmlNode -> bool

Returns true if the current node has the specified name

innerText n
Signature: n:HtmlNode -> string

Returns the inner text of the current node Parameters: * n - The given node

innerTextExcluding exclusions n
Signature: exclusions:string list -> n:HtmlNode -> string
name n
Signature: n:HtmlNode -> string

Gets the given nodes name

tryGetAttribute name n
Signature: name:string -> n:HtmlNode -> HtmlAttribute option

Tries to return an attribute that exists on the current node Parameters: * name - The name of the attribute to return.

Fork me on GitHub