2个版本
| 0.1.11 | 2021年4月2日 | 
|---|---|
| 0.1.10 | 2021年4月2日 | 
#27 in #selector
225KB
 2K  SLoC
Nos
A crate for manipulating HTML with Rust. (status: internal project)
Nos基于HTML crate html5ever和CSS选择器crate selectors。您可以使用类似jQuery的语法快速查询和操作HTML文档。 不仅可以查询,还可以修改。

示例
提取Hacker News。
use nos::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!();
    });
}
可读性。
相关项目
许可证
根据以下任一许可证授权
- Apache License, Version 2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT 或 https://open-source.org.cn/licenses/MIT)
您的选择。
贡献
除非您明确声明,否则根据Apache-2.0许可证定义的您有意提交的任何贡献,都应按上述方式双授权,不附加任何额外条款或条件。
依赖
~2.8–8.5MB
~74K SLoC