Trait scraper_main::ScraperMain [−][src]
pub trait ScraperMain: Sized { fn scrape(doc: &Document, container: Option<Node>) -> Result<Self>; }
Used to scrape data for a struct.
An example of this would be here:
pub struct RedditListItem { pub url: String } impl ScraperMain for RedditListItem { fn scrape(doc: &Document, container: Option<Node>) -> Result<Self> { Ok(Self { url: evaluate(".//a[@data-click-id=\"body\"]/@href", doc, container).convert_from(doc)? }) } }