stygian-extract-derive 0.15.0

Proc-macro backend for stygian-browser #[derive(Extract)]
Documentation

stygian-extract-derive

Proc-macro backend for stygian-browser's #[derive(Extract)].

Do not add this crate to your Cargo.toml directly. Use stygian-browser with the extract feature instead:

stygian-browser = { version = "*", features = ["extract"] }

Then annotate your struct:

use stygian_browser::extract::Extract;

#[derive(Extract)]
struct Product {
    #[selector("h2.title")]
    name: String,

    #[selector("button[data-sku]", attr = "data-sku")]
    sku: String,

    #[selector("img.hero", attr = "src")]
    image_url: Option<String>,
}