mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
25 lines
750 B
Markdown
25 lines
750 B
Markdown
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||
|
|
||
|
[Home](./index.md) > [puppeteer](./puppeteer.md) > [ElementHandle](./puppeteer.elementhandle.md) > [screenshot](./puppeteer.elementhandle.screenshot.md)
|
||
|
|
||
|
## ElementHandle.screenshot() method
|
||
|
|
||
|
This method scrolls element into view if needed, and then uses [Page.screenshot()](./puppeteer.page.screenshot.md) to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
|
||
|
|
||
|
<b>Signature:</b>
|
||
|
|
||
|
```typescript
|
||
|
screenshot(options?: {}): Promise<string | Buffer | void>;
|
||
|
```
|
||
|
|
||
|
## Parameters
|
||
|
|
||
|
| Parameter | Type | Description |
|
||
|
| --- | --- | --- |
|
||
|
| options | {} | |
|
||
|
|
||
|
<b>Returns:</b>
|
||
|
|
||
|
Promise<string \| Buffer \| void>
|
||
|
|