Files
puppeteer/docs/api/puppeteer.page.screencast.md
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Nikolay Vitkov
4afe06b61d chore(deps-dev): Bump the dev-dependencies group with 14 updates (#13982)
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Vitkov <[email protected]>
2025-07-02 08:16:05 +00:00

1.3 KiB

sidebar_label
sidebar_label
Page.screencast

Page.screencast() method

Captures a screencast of this page.

Signature

class Page {
  screencast(options?: Readonly<ScreencastOptions>): Promise<ScreenRecorder>;
}

Parameters

Parameter

Type

Description

options

Readonly<ScreencastOptions>

(Optional) Configures screencast behavior.

Returns:

Promise<ScreenRecorder>

Remarks

By default, all recordings will be WebM format using the VP9 video codec, with a frame rate of 30 FPS.

You must have ffmpeg installed on your system.

Example

Recording a page:

import puppeteer from 'puppeteer';

// Launch a browser
const browser = await puppeteer.launch();

// Create a new page
const page = await browser.newPage();

// Go to your site.
await page.goto("https://www.example.com");

// Start recording.
const recorder = await page.screencast({path: 'recording.webm'});

// Do something.

// Stop recording.
await recorder.stop();

browser.close();