victoria-dom

Crates.iovictoria-dom
lib.rsvictoria-dom
version0.1.2
sourcesrc
created_at2016-07-26 00:13:21.303014
updated_at2018-06-05 01:19:16.908798
descriptionMinimalistic HTML parser with CSS selectors
homepagehttps://github.com/khvzak/victoria-dom
repositoryhttps://github.com/khvzak/victoria-dom
max_upload_size
id5787
size178,083
Alex Orlenko (khvzak)

documentation

https://docs.rs/victoria-dom

README

victoria-dom

Minimalistic HTML parser with CSS selectors

crates.io Build Status Coverage Status Released API docs Master API docs

The project has been inspired by Mojo::DOM.

Installing

Add the following lines to your Cargo.toml file:

[dependencies]
victoria-dom = "0.1"

and this to your crate root:

extern crate victoria_dom;

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://docs.rs/victoria-dom

Commit count: 40

cargo fmt