1086 stable releases

new 2.45.19 Feb 15, 2026
2.40.2 Jan 23, 2026
2.38.110 Dec 26, 2025
2.38.23 Nov 29, 2025
0.1.3 Jul 24, 2024

#2789 in Command line utilities

Download history 26/week @ 2025-10-26 78/week @ 2025-11-02 106/week @ 2025-11-09 181/week @ 2025-11-16 148/week @ 2025-11-23 390/week @ 2025-11-30 291/week @ 2025-12-07 389/week @ 2025-12-14 198/week @ 2025-12-21 74/week @ 2025-12-28 100/week @ 2026-01-04 26/week @ 2026-01-11 21/week @ 2026-01-18 14/week @ 2026-01-25 211/week @ 2026-02-01 140/week @ 2026-02-08

390 downloads per month

MIT license

18KB
365 lines

spider_utils

Utilities to use to help with getting the most out of spider.

CSS Scraping

use spider::{
    hashbrown::HashMap,
    packages::scraper::Selector,
};
use spider_utils::{QueryCSSMap, QueryCSSSelectSet, build_selectors, css_query_select_map_streamed};

async fn css_query_selector_extract() {
    let map = QueryCSSMap::from([(
        "list",
        QueryCSSSelectSet::from([".list", ".sub-list"]),
    )]);
    let data = css_query_select_map_streamed(
        r#"<html>
            <body>
                <ul class="list"><li>First</li></ul>
                <ul class="sub-list"><li>Second</li></ul>
            </body>
        </html>"#,
        &build_selectors(map),
    )
    .await;

    println!("{:?}", data);
    // {"list": ["First", "Second"]}
}

Features

You can use the feature flag indexset to order the CSS scraping extraction order.

Dependencies

~12MB
~272K SLoC