Trait scrupy::spider::Spider [] [src]

pub trait Spider: Send + Sync {
    type ItemType;
    fn name(&self) -> &str;
    fn allowed_domains(&self) -> &[String];
    fn start_urls(&self) -> &[String];
    fn parse(&self, response: Response) -> (Vec<Request>, Vec<Self::ItemType>);

    fn start_requests(&self) -> Vec<Request> { ... }
    fn log(&self, _str: &str) { ... }
}

Associated Types

Required Methods

Returns the name of the spider.

Returns the allowed domains of the spider.

Returns a set of urls for the spider to start with.

Parse the Response and get a set of new Requests and items.

Provided Methods

Returns a set of start requests for the spider to start with. By default It will call start_urls() to get start urls and issue http get requests to those urls.

Logging functions of the spider. By default it will print error to stdout.

Implementors