← Back to Page domain
Page.captureSnapshot
Returns a snapshot of the page as a string. For MHTML format, the serialization includes
iframes, shadow DOM, external resources, and element-inline styles.
Domain: Page
experimental
Parameters
| Name | Type | Description |
format (optional) | string | Format (defaults to mhtml). |
Returns
| Name | Type | Description |
data | string | Serialized page data. |
Example Request
{
"id": 1,
"method": "Page.captureSnapshot"
}
Example Response
{
"id": 1,
"result": {
"data": "base64-encoded-data..."
}
}
Usage in Node.js
const result = await send('Page.captureSnapshot');
console.log(result);
// {"data": "base64-encoded-data..."}