2 releases
0.1.1 | Feb 9, 2025 |
---|---|
0.1.0 | Feb 8, 2025 |
#1982 in Web programming
248 downloads per month
7KB
81 lines
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);
}
});
}
Dependencies
~6–18MB
~237K SLoC