Struct tl::VDom [−][src]
pub struct VDom<'a> { /* fields omitted */ }Expand description
VDom represents a Document Object Model
It is the result of parsing an HTML document.
Internally it is only a wrapper around the Parser struct, but you do not need to know much about the Parser struct except for that all of the HTML tags are stored in here.
Many functions of the public API take a reference to a Parser as a parameter to resolve NodeHandles to Nodes.
Implementations
pub fn get_element_by_id<'b, S: ?Sized>(
&'b self,
id: &'b S
) -> Option<NodeHandle> where
S: AsBytes,
pub fn get_element_by_id<'b, S: ?Sized>(
&'b self,
id: &'b S
) -> Option<NodeHandle> where
S: AsBytes,
Finds an element by its id attribute.
pub fn get_elements_by_class_name<'b, S: ?Sized>(
&'b self,
id: &'b S
) -> Box<dyn Iterator<Item = NodeHandle>> where
S: AsBytes,
pub fn get_elements_by_class_name<'b, S: ?Sized>(
&'b self,
id: &'b S
) -> Box<dyn Iterator<Item = NodeHandle>> where
S: AsBytes,
Returns a list of elements that match a given class name.
Returns a slice of all the elements in the HTML document
The difference between children() and nodes() is that children only returns the immediate children of the root node,
while nodes() returns all nodes, including nested tags.
Returns the topmost subnodes (“children”) of this DOM
Returns the HTML version.
This is determined by the <!DOCTYPE> tag
👎 Deprecated since 0.3.0: please use nodes().iter().find(...) instead
please use nodes().iter().find(...) instead
Calls the given closure with each tag as parameter
The closure must return a boolean, indicating whether it should stop iterating
Returning true will break the loop