Interface CrawlerStrategy<A>

Type Parameters

  • A extends {
        [key: string]: CrawlerActor<unknown>;
    }

Hierarchy

  • CrawlerStrategy

Properties

actors: A

The actors that will be used to crawl.

The context options to use.

depth: number

The maximum depth.

entry: string

An absolute URL, the entry point.

init?: ((page: Page) => void | Promise<void>)

Type declaration

    • (page: Page): void | Promise<void>
    • Do something to the page when it is created.

      Parameters

      Returns void | Promise<void>

limiter?: RateLimiter

The rate limiter to use, including concurrency control.

post?: ((page: Page) => void | Promise<void>)

Type declaration

    • (page: Page): void | Promise<void>
    • Do something to the page after a task is run.

      Parameters

      Returns void | Promise<void>

pre?: ((page: Page) => void | Promise<void>)

Type declaration

    • (page: Page): void | Promise<void>
    • Do something to the page before a task is run.

      Parameters

      Returns void | Promise<void>

prune?: ((url: string) => boolean)

Type declaration

    • (url: string): boolean
    • Pre-pruning function. Return true to skip crawling a URL before it is loaded.

      Parameters

      • url: string

      Returns boolean

Generated using TypeDoc