• Stars
    star
    121
  • Rank 284,722 (Top 6 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Rust crate for manipulating HTML with CSS selectors

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

Related projects

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.

More Repositories

1

sensitive

敏感词查找,验证,过滤和替换 🤓 FindAll, Validate, Filter and Replace words.
Go
620
star
2

mobc

A generic connection pool for Rust with async/await support
Rust
276
star
3

rust-miniproxy

手把手教你用Rust写代理, 代码已完成, 文章不定期更新
JavaScript
146
star
4

rust-ajson

Rust port of gjson,get JSON value by dotpath syntax
Rust
103
star
5

gkd-rs

A multi-connections TCP accelerator, written in Rust
Rust
26
star
6

trie-go

The golang implementation of trie tree.
Go
24
star
7

danmu.go

基于golang的命令行形式的直播网站(斗鱼)的弹幕浏览
Go
18
star
8

react-affix

A simple react affix component(Deprecated, use sticky instead)
JavaScript
15
star
9

alphaid

Generate Youtube-Like IDs with Rust
Rust
12
star
10

mobc-redis

Redis support for the mobc connection pool
Rust
12
star
11

notes

My notes
10
star
12

mobc-postgres

Rust
9
star
13

neighbor

基于geohash和mysql实现的附近的人
Go
6
star
14

Posts

📫 Posts is a Python library for send mail easily.
Python
5
star
15

douyu

Crawler For DouyuTv Statistics
Python
4
star
16

yake

Pelican theme.
HTML
4
star
17

tiresias

simple demos for learning scarpy
Python
2
star
18

sparta

Douyu Statistic Backend
JavaScript
2
star
19

comethandler

🔫 helps the server which is builded with golang to push messages to the http clients easily.
Go
2
star
20

tide-demo

Rust
1
star
21

hackathon-2015

Eleme Hackathon 2015
Java
1
star
22

flask_restful_doc

Generate api docs for flask restful resource
Python
1
star
23

wisburg-terminal

JavaScript
1
star
24

bomd-server

base on markdown. a lightweight blog framework which id managed in local
CSS
1
star
25

noname

Go
1
star
26

remote-shortcuts

通过手机使用快捷键操作windows程序
Rust
1
star
27

init-react-webpack-project

A simple and small python2 script that can help you to init a react & webpack project.
Python
1
star