2023-09-22 12:08:46 +00:00
---
sidebar_label: ElementHandle.screenshot
---
# ElementHandle.screenshot() method
2023-10-06 11:48:06 +00:00
This method scrolls element into view if needed, and then uses [Page.screenshot() ](./puppeteer.page.screenshot_1.md ) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
2023-09-22 12:08:46 +00:00
#### Signature:
```typescript
class ElementHandle {
screenshot(
2023-11-02 15:51:26 +00:00
options: Readonly< ScreenshotOptions > & {
encoding: 'base64';
}
): Promise< string > ;
2023-09-22 12:08:46 +00:00
}
```
## Parameters
2023-12-06 08:04:56 +00:00
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------------------------------------------------------- | ----------- |
| options | Readonly< [ScreenshotOptions](./puppeteer.screenshotoptions.md)> & { encoding: 'base64'; } | |
2023-09-22 12:08:46 +00:00
**Returns:**
2023-11-02 15:51:26 +00:00
Promise< string>