html-url-scraper

Crates.iohtml-url-scraper
lib.rshtml-url-scraper
version0.1.1
created_at2025-02-08 15:07:36.991498+00
updated_at2025-02-09 08:23:17.090667+00
descriptionCrate for scraping URLs from HTML pages
homepage
repositoryhttps://github.com/pchchv/html-url-scraper
max_upload_size
id1548098
size17,286
Evgenii Pochechuev (pchchv)

documentation

README

Version License: Apache 2.0 Downloads

html-url-scraper

Simple library for quickly fetching a list of URLs from a webpage.

Example

use html_url_scraper::UrlScraper;

fn main() {
    let rt = tokio::runtime::Builder::new_current_thread()
        .enable_all()
        .build()
        .expect("Failed to create runtime");

    rt.block_on(async {
        let scraper = match UrlScraper::new("https://google.com").await {
            Ok(scraper) => scraper,
            Err(e) => {
                eprintln!("Error: {}", e);
                return;
            }
        };

        for (text, url) in scraper.into_iter() {
            println!("Текст: {}, Url: {}", text, url);
        }
    });
}
Commit count: 21

cargo fmt