10 releases

0.1.9 Mar 12, 2021
0.1.8 Jun 1, 2020
0.1.7 Apr 18, 2020

#2153 in Web programming

Download history 2466/week @ 2023-12-13 2052/week @ 2023-12-20 1928/week @ 2023-12-27 2319/week @ 2024-01-03 2395/week @ 2024-01-10 2422/week @ 2024-01-17 2882/week @ 2024-01-24 2976/week @ 2024-01-31 2789/week @ 2024-02-07 2367/week @ 2024-02-14 2424/week @ 2024-02-21 2387/week @ 2024-02-28 2440/week @ 2024-03-06 2525/week @ 2024-03-13 2315/week @ 2024-03-20 1971/week @ 2024-03-27

9,631 downloads per month
Used in 16 crates (13 directly)

MIT/Apache

225KB
2K SLoC

Nipper

A crate for manipulating HTML with Rust.

Nipper based on HTML crate html5ever and the CSS selector crate selectors. You can use the jQuery-like syntax to query and manipulate an HTML document quickly. Not only can query, but also can modify.

nipper-logo

Example

Extract the hacker news.

use nipper::Document;

fn main() {
    let html = include_str!("../test-pages/hacker_news.html");
    let document = Document::from(html);

    document.select("tr.athing").iter().for_each(|athing| {
        let title = athing.select(".title a");
        let href = athing.select(".storylink");
        println!("{}", title.text());
        println!("{}", href.attr("href").unwrap());
        println!();
    });
}

Readability.

examples/readability.rs

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4–10MB
~90K SLoC