Skip to main content
Version: Next

stagehandBrowserPool

Callable


  • Builds a BrowserPool of Stagehand browsers to pass to a StagehandCrawler as its browserPool.

    It accepts every BrowserPool option plus the crawler's own launchContext, stagehandOptions 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 StagehandPlugin by hand.

    Example usage:

    const crawler = new StagehandCrawler({
    browserPool: stagehandBrowserPool({
    maxOpenPagesPerBrowser: 1,
    stagehandOptions: { env: 'LOCAL', model: 'openai/gpt-4.1-mini' },
    }),
    requestHandler: async ({ page }) => { ... },
    });

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


    Parameters

    Returns StagehandBrowserPool