metascraper

Crates.iometascraper
lib.rsmetascraper
version0.2.2
sourcesrc
created_at2022-12-25 22:13:00.058506
updated_at2023-01-11 09:29:37.801645
descriptionMetaScraper is a extracts metadata information of a website.
homepage
repositoryhttps://github.com/mehmetcansahin/metascraper
max_upload_size
id745478
size16,530
mehmetcan (mehmetcansahin)

documentation

https://docs.rs/metascraper

README

MetaScraper

Rust crates.io Released API docs MIT licensed

MetaScraper is a extracts metadata information of a website.

MetaScraper uses tl as its html parser. This choice was made because tl was the fastest in benchmark tests. For more information, visit the parse_query_bench GitHub page.

Usage

let input = include_str!("test.html");
let metascraper = MetaScraper::parse(input).unwrap();
println!("{}", metascraper.title().unwrap());
// Title
let metadata = metascraper.metadata();
println!("{:?}", metadata);
// MetaData {
//     title: Some("Title"),
//     description: Some("Description"),
//     canonical: Some("https://mehmetcan.sahin.dev"),
//     language: Some("en"),
//     rss: Some("rss.xml"),
//     metatags: Some([
//         Metatag { name: "X-UA-Compatible", content: "IE=edge" },
//         Metatag { name: "viewport", content: "width=device-width, initial-scale=1.0" },
//         Metatag { name: "description", content: "Description" }
//         ])
// }

License

MetaScraper is licensed under the MIT License.

Commit count: 20

cargo fmt