Skip to main content
Version: Next

StagehandLaunchContext

Launch context for Stagehand crawler with AI-specific options.

Hierarchy

Index

Properties

optionalinheritedbrowserPerProxy

browserPerProxy?: boolean

If set to true, the crawler respects the proxy url generated for the given request. This aligns the browser-based crawlers with the HttpCrawler.

Might cause performance issues, as Crawlee might launch too many browser instances.

optionalinheritedexperimentalContainers
experimental

experimentalContainers?: boolean

Like useIncognitoPages, but for persistent contexts, so cache is used for faster loading. Works best with Firefox. Unstable on Chromium.

optionallauncher

launcher?: BrowserType<{}>

By default this function uses require("playwright").chromium. If you want to use a different browser you can pass it by this property.

optionallaunchOptions

launchOptions?: LaunchOptions & { acceptDownloads?: boolean; args?: string[]; baseURL?: string; bypassCSP?: boolean; channel?: string; chromiumSandbox?: boolean; clientCertificates?: { cert?: Buffer<ArrayBufferLike>; certPath?: string; key?: Buffer<ArrayBufferLike>; keyPath?: string; origin: string; passphrase?: string; pfx?: Buffer<ArrayBufferLike>; pfxPath?: string }[]; colorScheme?: null | light | dark | no-preference; contrast?: null | no-preference | more; deviceScaleFactor?: number; devtools?: boolean; downloadsPath?: string; env?: {}; executablePath?: string; extraHTTPHeaders?: {}; firefoxUserPrefs?: {}; forcedColors?: null | active | none; geolocation?: { accuracy?: number; latitude: number; longitude: number }; handleSIGHUP?: boolean; handleSIGINT?: boolean; handleSIGTERM?: boolean; hasTouch?: boolean; headless?: boolean; httpCredentials?: { origin?: string; password: string; send?: unauthorized | always; username: string }; ignoreDefaultArgs?: boolean | string[]; ignoreHTTPSErrors?: boolean; isMobile?: boolean; javaScriptEnabled?: boolean; locale?: string; logger?: Logger; offline?: boolean; permissions?: string[]; proxy?: { bypass?: string; password?: string; server: string; username?: string }; recordHar?: { content?: omit | embed | attach; mode?: full | minimal; omitContent?: boolean; path: string; urlFilter?: string | RegExp }; recordVideo?: { dir: string; size?: { height: number; width: number } }; reducedMotion?: null | reduce | no-preference; screen?: { height: number; width: number }; serviceWorkers?: allow | block; slowMo?: number; strictSelectors?: boolean; timeout?: number; timezoneId?: string; tracesDir?: string; userAgent?: string; videoSize?: { height: number; width: number }; videosPath?: string; viewport?: null | { height: number; width: number } }

Playwright launch options. These will be passed to Stagehand's localBrowserLaunchOptions after fingerprinting is applied.

optionalproxyUrl

proxyUrl?: string

URL to a HTTP proxy server. It must define the port number, and it may also contain proxy username and password.

Example: http://bob:pass123@proxy.example.com:1234.

optionalstagehandOptions

stagehandOptions?: StagehandOptions

Stagehand-specific configuration for AI operations.

optionaluseChrome

useChrome?: boolean = false

If true and executablePath is not set, Playwright will launch full Google Chrome browser available on the machine rather than the bundled Chromium.

optionaluseIncognitoPages

useIncognitoPages?: boolean = false

With this option selected, all pages will be opened in a new incognito browser context.

optionalinheriteduserAgent

userAgent?: string

The User-Agent HTTP header used by the browser. If not provided, the function sets User-Agent to a reasonable default to reduce the chance of detection of the crawler.

optionaluserDataDir

userDataDir?: string

Sets the User Data Directory path. The user data directory contains profile data such as history, bookmarks, and cookies.