Skip to main content
Version: Next

puppeteerBrowserPool

Callable


  • Builds a BrowserPool of Puppeteer browsers to pass to a PuppeteerCrawler as its browserPool.

    It accepts every BrowserPool option plus the crawler's own launchContext and headless, and derives the browser plugin from them - so a pool built here always matches the crawler it is given to, and configuring one never means assembling a PuppeteerPlugin by hand.

    Example usage:

    const crawler = new PuppeteerCrawler({
    browserPool: puppeteerBrowserPool({ maxOpenPagesPerBrowser: 1 }),
    requestHandler: async ({ page }) => { ... },
    });

    The returned pool is not torn down by the crawler, which is what makes it shareable between crawlers.


    Parameters

    Returns PuppeteerBrowserPool