-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
As the example, the following code works correctly.
use scraper::{Html, Selector};
fn main() {
let html = r#"
<ul>
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</ul>
"#;
let fragment = Html::parse_fragment(html);
let selector = Selector::parse("ul").unwrap();
assert!(fragment.select(&selector).next().is_some());
}
Although the following code is almost same as the above one, it doesn't work.
use scraper::{Html, Selector};
fn main() {
let html = r#"
<tr>
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</tr>
"#;
let fragment = Html::parse_fragment(html);
let selector = Selector::parse("tr").unwrap();
assert!(fragment.select(&selector).next().is_some());
}
Metadata
Metadata
Assignees
Labels
No labels