Crate nos[][src]

HTML manipulation with CSS selectors.

Features

  • Iteration
  • Manipulation
  • Property
  • Query
  • Traversal

Get started

use nos::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

Document represents an HTML document to be manipulated.

Matcher

CSS selector.

NodeRef
Selection

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.

Selections

Iterator over a collection of matched elements.

Type Definitions

Node

Alias for NodeRef.