PuppeteerLaunchContext
PuppeteerLaunchContextDeprecated
Apify extends the launch options of Puppeteer. You can use any of the Puppeteer compatible
LaunchOptions options by providing the launchOptions property.
Example:
// launch a headless Chrome (not Chromium)
const launchContext = {
// Apify helpers
useChrome: true,
proxyUrl: 'http://user:password@some.proxy.com'
// Native Puppeteer options
launchOptions: {
headless: true,
args: ['--some-flag'],
}
}
Properties
launchOptions
Type: Record<string, any>
puppeteer.launch options
proxyUrl
Type: 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.
userAgent
Type: 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.
useChrome
Type: boolean = false
If true and executablePath is not set, Puppeteer will launch full Google Chrome browser available on the machine rather than the bundled Chromium.
The path to Chrome executable is taken from the APIFY_CHROME_EXECUTABLE_PATH environment variable if provided, or defaults to the typical Google
Chrome executable location specific for the operating system. By default, this option is false.
launcher
Type: *
Already required module (Object). This enables usage of various Puppeteer wrappers such as puppeteer-extra.
Take caution, because it can cause all kinds of unexpected errors and weird behavior. Apify SDK is not tested with any other library besides
puppeteer itself.
useIncognitoPages
Type: boolean = 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.
stealth
Type: boolean
stealthOptions
Type: StealthOptions