puppeteer/website/versioned_docs/version-9.1.1/puppeteer.elementhandle.screenshot.md
2021-08-10 11:09:48 +01:00

750 B

Home > puppeteer > ElementHandle > screenshot

ElementHandle.screenshot() method

This method scrolls element into view if needed, and then uses Page.screenshot() to take a screenshot of the element. If the element is detached from DOM, the method throws an error.

Signature:

screenshot(options?: {}): Promise<string | Buffer | void>;

Parameters

Parameter Type Description
options {}

Returns:

Promise<string | Buffer | void>