HTML Soup
Examples
# extern crate soup;
# use Error;
# use *;
#
HTML Soup
# extern crate soup;
# use std::error::Error;
# use soup::prelude::*;
# fn main() -> Result<(), Box<Error>> {
let html = r#"
<!DOCTYPE html>
<html>
<head>
<title>My title</title>
</head>
<body>
<h1>My Heading</h1>
<p>Some text</p>
<p>Some more text</p>
</body>
</html>
"#;
let soup = Soup::new(html);
assert_eq!(
soup.find()
.tag("p")
.execute()?
.and_then(|p| p.text()),
Some("Some text".to_string())
);
# Ok(())
# }