Crate dom_query

source ·
Expand description

HTML manipulation with CSS selectors.

§Features

  • Iteration
  • Manipulation
  • Property
  • Query
  • Traversal

§Get started

use dom_query::Document;

let html = r#"<div>
    <a href="/1">One</a>
    <a href="/2">Two</a>
    <a href="/3">Three</a>
</div>"#;

let document = Document::from(html);
let a = document.select("a:nth-child(3)");
let text: &str = &a.text();
assert!(text == "Three");

Structs§

  • Document represents an HTML document to be manipulated.
  • CSS selector.
  • Selection represents a collection of nodes matching some criteria. The initial Selection object can be created by using [Document::select], and then manipulated using methods itself.
  • Iterator over a collection of matched elements.

Enums§

  • The different kinds of nodes in the DOM.

Type Aliases§

  • Alias for NodeRef.