2022-07-05 13:41:43 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Page.screenshot
|
|
|
|
---
|
|
|
|
|
|
|
|
# Page.screenshot() method
|
|
|
|
|
2023-09-21 19:21:12 +00:00
|
|
|
Captures a screenshot of this [page](./puppeteer.page.md).
|
2023-03-30 11:54:00 +00:00
|
|
|
|
2022-10-24 07:07:05 +00:00
|
|
|
#### Signature:
|
2022-07-05 13:41:43 +00:00
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Page {
|
2023-09-21 19:21:12 +00:00
|
|
|
screenshot(
|
|
|
|
options: Readonly<ScreenshotOptions> & {
|
2023-01-18 14:06:20 +00:00
|
|
|
encoding: 'base64';
|
|
|
|
}
|
|
|
|
): Promise<string>;
|
2022-07-05 13:41:43 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
2024-03-20 15:03:14 +00:00
|
|
|
<table><thead><tr><th>
|
2022-07-05 13:41:43 +00:00
|
|
|
|
2024-03-20 15:03:14 +00:00
|
|
|
Parameter
|
|
|
|
|
|
|
|
</th><th>
|
|
|
|
|
|
|
|
Type
|
|
|
|
|
|
|
|
</th><th>
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
|
|
|
</th></tr></thead>
|
|
|
|
<tbody><tr><td>
|
|
|
|
|
|
|
|
options
|
|
|
|
|
|
|
|
</td><td>
|
|
|
|
|
|
|
|
Readonly<[ScreenshotOptions](./puppeteer.screenshotoptions.md)> & { encoding: 'base64'; }
|
|
|
|
|
|
|
|
</td><td>
|
|
|
|
|
|
|
|
Configures screenshot behavior.
|
|
|
|
|
|
|
|
</td></tr>
|
|
|
|
</tbody></table>
|
2022-07-05 13:41:43 +00:00
|
|
|
**Returns:**
|
|
|
|
|
2023-01-18 14:06:20 +00:00
|
|
|
Promise<string>
|