#[test] fn ready() { println!("it works!") } use htmler::{Html, Selector}; #[test] fn tag_with_newline() { let selector = Selector::try_from("a").unwrap(); let document = Html::parse_fragment( r#" "#, ); let mut iter = document.select(&selector); let a = iter.next().unwrap(); assert_eq!(a.get_attribute("href"), "https://github.com/causal-agent/scraper"); } #[test] fn main() { let fragment = Html::parse_fragment("

"); for node in fragment.root_node().descendants() { match node.as_element() { None => {} Some(s) => { println!("{:#?}", s); } } } }