Skip to main content
Version: 3.11

BrowserLaunchContext <TOptions, Launcher>

Hierarchy

Index

Properties

optionalbrowserPerProxy

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.

optionalexperimentalContainers
experimental

experimentalContainers?: boolean

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

optionallaunchOptions

launchOptions?: TOptions

Options that will be passed down to the automation library. E.g. puppeteer.launch(launchOptions);. This is a good place to set options that you want to apply as defaults. To dynamically override those options per-browser, see the preLaunchHooks of BrowserPool.

optionallauncher

launcher?: Launcher

The type of browser to be launched. By default, chromium is used. Other browsers like webkit or firefox can be used.

@example
// import the browser from the library first
import { firefox } from 'playwright';

For more details, check out the example.

optionalproxyUrl

proxyUrl?: string

URL to an 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`.

optionaluseChrome

useChrome?: boolean = ```ts false ```

If true and the executablePath option of launchOptions is not set, the launcher will launch full Google Chrome browser available on the machine rather than the bundled Chromium. The path to Chrome executable is taken from the CRAWLEE_CHROME_EXECUTABLE_PATH environment variable if provided, or defaults to the typical Google Chrome executable location specific for the operating system.

optionaluseIncognitoPages

useIncognitoPages?: boolean = ```ts false ```

With this option selected, all pages will be opened in a new incognito browser context. This means they will not share cookies nor cache and their resources will not be throttled by one another.

optionaluserAgent

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, as well as other per-installation local state. If not specified, a temporary directory is used instead.