Skip to main content

Scraper

Trait Scraper 

Source
pub trait Scraper: Send + Sync {
    // Required method
    fn scrape<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ScrapeResult, ScrapeError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for scraping URLs (allows mocking in tests).

Implement this trait to provide different scraping backends. The default implementation uses FirecrawlCli.

Required Methods§

Source

fn scrape<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ScrapeResult, ScrapeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Scrape a URL and return the result.

Implementors§