victoria-dom 0.1.0

Minimalistic HTML parser with CSS selectors
Documentation

victoria-dom

Minimalistic HTML parser with CSS selectors

MIT licensed

The project has been inspired by Mojo::DOM.

Installing

Add the following lines to the Cargo.toml file:

[dependencies]
victoria-dom = "0.1.*"

Examples

extern crate victoria_dom;

use victoria_dom::DOM;

fn main() {
    let html = r#"<html><div id="main">Hello, <a href="http://rust-lang.org" alt="The Rust Programing Language">Rust</a></div></html>"#;
    let dom = DOM::new(html);

    assert_eq!(dom.at("html").unwrap().text_all(), "Hello, Rust");
    assert_eq!(dom.at("div#main > a").unwrap().attr("alt").unwrap(), "The Rust Programing Language");
}

Documentation

https://khvzak.github.io/victoria-dom/