Crates.io | wappu |
lib.rs | wappu |
version | 0.3.0 |
source | src |
created_at | 2024-02-25 16:14:19.767307 |
updated_at | 2024-03-31 16:25:27.380231 |
description | Wappu is a fast and flexible web scraping library for Rust, designed to efficiently navigate and extract data from websites. Perfect for data mining, content aggregation, and web automation tasks. |
homepage | |
repository | |
max_upload_size | |
id | 1152587 |
size | 55,605 |
Wappu is a comprehensive web scraping library written in Rust, designed for ease of use and performance. It integrates seamlessly HTTP client capabilities with powerful HTML parsing functionalities, allowing users to fetch and parse web content efficiently.
Ensure you have Rust and Cargo installed on your system. Wappu requires Rust version 1.40 or newer.
Add Wappu to your project's Cargo.toml
:
[dependencies]
wappu = "0.2.4"
reqwest = "0.11.24"
Here's a quick example to fetch and parse the title of example.com:
use wappu::{WappuClient, HtmlParser, Selector};
#[tokio::main]
async fn main() {
let client = WappuClient::new();
let html_content = client.get("http://example.com", None).await.expect("Failed to fetch content");
let parsed_html = HtmlParser::new().parse_html(&html_content.text());
let mut selector = Selector::new();
let title_selector = selector.from_tag_name("h1");
let title_selection = title_selector.select(&parsed_html);
let title_text = title_selection.text();
println!("Title: {}", title_text);
}
For detailed documentation, including API reference and advanced usage, visit Wappu Documentation. (Not yet done)
Contributions are welcome! Please see our Contributing Guide for more details.
Wappu is licensed under the Apache License 2.0 - see the LICENSE file for details.