spider_lib/lib.rs
1//! # spider-lib
2//!
3//! A Rust-based web scraping framework inspired by Scrapy.
4//!
5//! `spider-lib` is an asynchronous web scraping library for Rust.
6//! It integrates core engine, macros, middleware, and pipelines into a unified library.
7//!
8//! ## Quick Start
9//!
10//! ```toml
11//! [dependencies]
12//! spider-lib = "1.1.1"
13//! serde = { version = "1.0", features = ["derive"] }
14//! serde_json = "1.0"
15//! ```
16//!
17//! ```rust,ignore
18//! use spider_lib::prelude::*;
19//!
20//! #[scraped_item]
21//! struct Quote {
22//! text: String,
23//! author: String,
24//! }
25//!
26//! struct QuotesSpider;
27//!
28//! #[async_trait]
29//! impl Spider for QuotesSpider {
30//! type Item = Quote;
31//! fn start_urls(&self) -> Vec<&'static str> {
32//! vec!["http://quotes.toscrape.com/"]
33//! }
34//! async fn parse(&mut self, response: Response) -> Result<ParseOutput<Self::Item>, SpiderError> {
35//! // parsing logic
36//! todo!()
37//! }
38//! }
39//! ```
40
41pub mod prelude;
42pub use prelude::*;