Skip to main content

parse

Function parse 

Source
pub fn parse(html: &str) -> Dom
Expand description

Parse a full HTML document into a best-effort tree.

Never panics. Any recovery the parser performed is recorded in Dom::errors.

let dom = domtree::parse("<p>hello<p>world");
assert_eq!(dom.find_by_tag("p").count(), 2); // implicit </p>