| Crates.io | html-url-scraper |
| lib.rs | html-url-scraper |
| version | 0.1.1 |
| created_at | 2025-02-08 15:07:36.991498+00 |
| updated_at | 2025-02-09 08:23:17.090667+00 |
| description | Crate for scraping URLs from HTML pages |
| homepage | |
| repository | https://github.com/pchchv/html-url-scraper |
| max_upload_size | |
| id | 1548098 |
| size | 17,286 |
Simple library for quickly fetching a list of URLs from a webpage.
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);
}
});
}