API Reference
Classes
Class | Description |
---|---|
Accessibility | The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as screen readers or switches. |
Browser | Browser represents a browser instance that is either: - connected to via Puppeteer.connect() or - launched by PuppeteerNode.launch(). Browser emits various events which are documented in the BrowserEvent enum. |
BrowserContext | BrowserContext represents individual user contexts within a browser. When a browser is launched, it has a single browser context by default. Others can be created using Browser.createBrowserContext(). Each context has isolated storage (cookies/localStorage/etc.) BrowserContext emits various events which are documented in the BrowserContextEvent enum. If a page opens another page, e.g. using |
CDPSession | The CDPSession instances are used to talk raw Chrome Devtools Protocol. |
Connection | |
ConsoleMessage | ConsoleMessage objects are dispatched by page via the 'console' event. |
Coverage | The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page. |
CSSCoverage | |
DeviceRequestPrompt | Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth. |
DeviceRequestPromptDevice | Device in a request prompt. |
Dialog | Dialog instances are dispatched by the Page via the dialog event. |
ElementHandle | ElementHandle represents an in-page DOM element. |
EventEmitter | The EventEmitter class that many Puppeteer classes extend. |
FileChooser | File choosers let you react to the page requesting for a file. |
Frame | Represents a DOM frame. To understand frames, you can think of frames as |
HTTPRequest | Represents an HTTP request sent by a page. |
HTTPResponse | The HTTPResponse class represents responses which are received by the Page class. |
JSCoverage | |
JSHandle | Represents a reference to a JavaScript object. Instances can be created using Page.evaluateHandle(). Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely disposed. JSHandles are auto-disposed when their associated frame is navigated away or the parent context gets destroyed. Handles can be used as arguments for any evaluation function such as Page.$eval(), Page.evaluate(), and Page.evaluateHandle(). They are resolved to their referenced object. |
Keyboard | Keyboard provides an api for managing a virtual keyboard. The high level api is Keyboard.type(), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. |
Locator | Locators describe a strategy of locating objects and performing an action on them. If the action fails because the object is not ready for the action, the whole operation is retried. Various preconditions for a successful action are checked automatically. |
Mouse | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. |
Page | Page provides methods to interact with a single tab or extension background page in the browser. :::note One Browser instance might have multiple Page instances. ::: |
ProductLauncher | Describes a launcher - a class that is able to create and launch a browser instance. |
ProtocolError | ProtocolError is emitted whenever there is an error from the protocol. |
Puppeteer | The main Puppeteer class. IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of PuppeteerNode when you import or require |
PuppeteerError | The base class for all Puppeteer-specific errors |
PuppeteerNode | Extends the main Puppeteer class with Node specific behaviour for fetching and downloading browsers. If you're using Puppeteer in a Node environment, this is the class you'll get when you run |
ScreenRecorder | |
SecurityDetails | The SecurityDetails class represents the security details of a response that was received over a secure connection. |
Target | Target represents a CDP target. In CDP a target is something that can be debugged such a frame, a page or a worker. |
TimeoutError | TimeoutError is emitted whenever certain operations are terminated due to timeout. |
Touchscreen | The Touchscreen class exposes touchscreen events. |
Tracing | The Tracing class exposes the tracing audit interface. |
UnsupportedOperation | Puppeteer will throw this error if a method is not supported by the currently used protocol |
WebWorker | This class represents a WebWorker. |
Enumerations
Enumeration | Description |
---|---|
BrowserContextEvent | |
BrowserEvent | All the events a browser instance may emit. |
InterceptResolutionAction | |
LocatorEvent | All the events that a locator instance may emit. |
PageEvent | All the events that a page instance may emit. |
TargetType |
Functions
Function | Description |
---|---|
clearCustomQueryHandlers() | |
customQueryHandlerNames() | |
registerCustomQueryHandler(name, handler) | |
unregisterCustomQueryHandler(name) |
Interfaces
Namespaces
Namespace | Description |
---|---|
CDPSessionEvent | Events that the CDPSession class emits. |
Variables
Variable | Description |
---|---|
connect | |
DEFAULT_INTERCEPT_RESOLUTION_PRIORITY | The default cooperative request interception resolution priority |
defaultArgs | |
executablePath | |
KnownDevices | A list of devices to be used with Page.emulate(). |
launch | |
MouseButton | Enum of valid mouse buttons. |
PredefinedNetworkConditions | A list of network conditions to be used with Page.emulateNetworkConditions(). |
puppeteer | |
trimCache |
Type Aliases
Type Alias | Description |
---|---|
ActionResult | |
Awaitable | |
AwaitableIterable | |
AwaitablePredicate | |
AwaitedLocator | |
CDPEvents | |
ChromeReleaseChannel | |
ConsoleMessageType | The supported types for console messages. |
CookiePriority | Represents the cookie's 'Priority' status: https://tools.ietf.org/html/draft-west-cookie-priority-00 |
CookieSameSite | Represents the cookie's 'SameSite' status: https://tools.ietf.org/html/draft-west-first-party-cookies |
CookieSourceScheme | Represents the source scheme of the origin that originally set the cookie. A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. This is a temporary ability and it will be removed in the future. |
ElementFor | |
ErrorCode | |
EvaluateFunc | |
EvaluateFuncWith | |
EventsWithWildcard | |
EventType | |
ExperimentsConfiguration | Defines experiment options for Puppeteer. See individual properties for more information. |
FlattenHandle | |
HandleFor | |
HandleOr | |
Handler | |
InnerParams | |
KeyInput | All the valid keys that can be passed to functions that take user input, such as keyboard.press |
KeyPressOptions | |
LocatorClickOptions | |
LowerCasePaperFormat | |
Mapper | |
MouseButton | |
NodeFor | |
PaperFormat | All the valid paper format types when printing a PDF. |
Permission | |
Predicate | |
Product | Supported products. |
ProtocolLifeCycleEvent | |
ProtocolType | |
PuppeteerLifeCycleEvent | |
PuppeteerNodeLaunchOptions | Utility type exposed to enable users to define options that can be passed to puppeteer.launch without having to list the set of all types. |
Quad | |
ResourceType | Resource types for HTTPRequests as perceived by the rendering engine. |
TargetFilterCallback | |
VisibilityOption |