Captures a screenshot of this page.
class Page {
screenshot(
options: Readonly<ScreenshotOptions> & {
encoding: 'base64';
},
): Promise<string>;
}
Parameter | Type | Description |
---|---|---|
options | Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> & { encoding: 'base64'; } | Configures screenshot behavior. |
Returns:
Promise<string>
While a screenshot is being taken in a BrowserContext, the following methods will automatically wait for the screenshot to finish to prevent interference with the screenshot process: BrowserContext.newPage(), Browser.newPage(), Page.close().
Calling Page.bringToFront() will not wait for existing screenshot operations.
class Page {
screenshot(options?: Readonly<ScreenshotOptions>): Promise<Uint8Array>;
}
Parameter | Type | Description |
---|---|---|
options | Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> | _(Optional)_ |
Returns:
Promise<Uint8Array>