---
sidebar_label: API
---
# API Reference
## Classes
| Class | Description |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Accessibility](./puppeteer.accessibility.md) | The Accessibility class provides methods for inspecting the browser's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). |
| [Browser](./puppeteer.browser.md) | A Browser is created when Puppeteer connects to a browser instance, either through [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md) or [Puppeteer.connect()](./puppeteer.puppeteer.connect.md). |
| [BrowserContext](./puppeteer.browsercontext.md) | BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method [Browser.newPage](./puppeteer.browser.newpage.md) creates a page in the default browser context. |
| [CDPSession](./puppeteer.cdpsession.md) | The CDPSession
instances are used to talk raw Chrome Devtools Protocol. |
| [Connection](./puppeteer.connection.md) | |
| [ConsoleMessage](./puppeteer.consolemessage.md) | ConsoleMessage objects are dispatched by page via the 'console' event. |
| [Coverage](./puppeteer.coverage.md) | The Coverage class provides methods to gather information about parts of JavaScript and CSS that were used by the page. |
| [CSSCoverage](./puppeteer.csscoverage.md) | |
| [CustomError](./puppeteer.customerror.md) | |
| [DeviceRequestPrompt](./puppeteer.devicerequestprompt.md) | Device request prompts let you respond to the page requesting for a device through an API like WebBluetooth. |
| [DeviceRequestPromptDevice](./puppeteer.devicerequestpromptdevice.md) | Device in a request prompt. |
| [Dialog](./puppeteer.dialog.md) | Dialog instances are dispatched by the [Page](./puppeteer.page.md) via the dialog
event. |
| [ElementHandle](./puppeteer.elementhandle.md) | ElementHandle represents an in-page DOM element. |
| [EventEmitter](./puppeteer.eventemitter.md) | The EventEmitter class that many Puppeteer classes extend. |
| [FileChooser](./puppeteer.filechooser.md) | File choosers let you react to the page requesting for a file. |
| [Frame](./puppeteer.frame.md) |
Represents a DOM frame.
To understand frames, you can think of frames as <iframe>
elements. Just like iframes, frames can be nested, and when JavaScript is executed in a frame, the JavaScript does not effect frames inside the ambient frame the JavaScript executes in.
Represents a reference to a JavaScript object. Instances can be created using [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md).
Handles prevent the referenced JavaScript object from being garbage-collected unless the handle is purposely [disposed](./puppeteer.jshandle.dispose.md). 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()](./puppeteer.page._eval.md), [Page.evaluate()](./puppeteer.page.evaluate.md), and [Page.evaluateHandle()](./puppeteer.page.evaluatehandle.md). They are resolved to their referenced object.
| | [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. | | [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. | | [Page](./puppeteer.page.md) |Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in the browser.
:::note
One Browser instance might have multiple Page instances.
:::
| | [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. | | [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. | | [Puppeteer](./puppeteer.puppeteer.md) |The main Puppeteer class.
IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require puppeteer
. That class extends Puppeteer
, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).
Extends the main [Puppeteer](./puppeteer.puppeteer.md) 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 require('puppeteer')
(or the equivalent ES import
).
Defines options to configure Puppeteer's behavior during installation and runtime.
See individual properties for more information.
| | [ConnectionTransport](./puppeteer.connectiontransport.md) | | | [ConnectOptions](./puppeteer.connectoptions.md) | | | [ConsoleMessageLocation](./puppeteer.consolemessagelocation.md) | | | [ContinueRequestOverrides](./puppeteer.continuerequestoverrides.md) | | | [CoverageEntry](./puppeteer.coverageentry.md) | The CoverageEntry class represents one entry of the coverage report. | | [Credentials](./puppeteer.credentials.md) | | | [CSSCoverageOptions](./puppeteer.csscoverageoptions.md) | Set of configurable options for CSS coverage. | | [CustomQueryHandler](./puppeteer.customqueryhandler.md) | | | [Device](./puppeteer.device.md) | | | [FrameAddScriptTagOptions](./puppeteer.frameaddscripttagoptions.md) | | | [FrameAddStyleTagOptions](./puppeteer.frameaddstyletagoptions.md) | | | [FrameWaitForFunctionOptions](./puppeteer.framewaitforfunctionoptions.md) | | | [GeolocationOptions](./puppeteer.geolocationoptions.md) | | | [InterceptResolutionState](./puppeteer.interceptresolutionstate.md) | | | [InternalNetworkConditions](./puppeteer.internalnetworkconditions.md) | | | [JSCoverageEntry](./puppeteer.jscoverageentry.md) | The CoverageEntry class for JavaScript | | [JSCoverageOptions](./puppeteer.jscoverageoptions.md) | Set of configurable options for JS coverage. | | [LaunchOptions](./puppeteer.launchoptions.md) | Generic launch options that can be passed when launching any browser. | | [MediaFeature](./puppeteer.mediafeature.md) | | | [Metrics](./puppeteer.metrics.md) | | | [MouseClickOptions](./puppeteer.mouseclickoptions.md) | | | [MouseMoveOptions](./puppeteer.mousemoveoptions.md) | | | [MouseOptions](./puppeteer.mouseoptions.md) | | | [MouseWheelOptions](./puppeteer.mousewheeloptions.md) | | | [NetworkConditions](./puppeteer.networkconditions.md) | | | [Offset](./puppeteer.offset.md) | | | [PageEventObject](./puppeteer.pageeventobject.md) |Denotes the objects received by callback functions for page events.
See [PageEmittedEvents](./puppeteer.pageemittedevents.md) for more detail on the events and when they are emitted.
| | [PDFMargin](./puppeteer.pdfmargin.md) | | | [PDFOptions](./puppeteer.pdfoptions.md) | Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md). | | [Point](./puppeteer.point.md) | | | [PressOptions](./puppeteer.pressoptions.md) | | | [PuppeteerErrors](./puppeteer.puppeteererrors.md) | | | [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | | | [RemoteAddress](./puppeteer.remoteaddress.md) | | | [ResponseForRequest](./puppeteer.responseforrequest.md) | Required response data to fulfill a request with. | | [ScreenshotClip](./puppeteer.screenshotclip.md) | | | [ScreenshotOptions](./puppeteer.screenshotoptions.md) | | | [SerializedAXNode](./puppeteer.serializedaxnode.md) | Represents a Node and the properties of it that are relevant to Accessibility. | | [SnapshotOptions](./puppeteer.snapshotoptions.md) | | | [TracingOptions](./puppeteer.tracingoptions.md) | | | [Viewport](./puppeteer.viewport.md) | Sets the viewport of the page. | | [WaitForOptions](./puppeteer.waitforoptions.md) | | | [WaitForSelectorOptions](./puppeteer.waitforselectoroptions.md) | | | [WaitForTargetOptions](./puppeteer.waitfortargetoptions.md) | | | [WaitTimeoutOptions](./puppeteer.waittimeoutoptions.md) | | ## Variables | Variable | Description | | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | [connect](./puppeteer.connect.md) | | | [DEFAULT_INTERCEPT_RESOLUTION_PRIORITY](./puppeteer.default_intercept_resolution_priority.md) | The default cooperative request interception resolution priority | | [defaultArgs](./puppeteer.defaultargs.md) | | | [devices](./puppeteer.devices.md) | | | [errors](./puppeteer.errors.md) | | | [EVALUATION_SCRIPT_URL](./puppeteer.evaluation_script_url.md) | | | [executablePath](./puppeteer.executablepath.md) | | | [KnownDevices](./puppeteer.knowndevices.md) | A list of devices to be used with [Page.emulate()](./puppeteer.page.emulate.md). | | [launch](./puppeteer.launch.md) | | | [MouseButton](./puppeteer.mousebutton.md) | Enum of valid mouse buttons. | | [networkConditions](./puppeteer.networkconditions.md) | | | [PredefinedNetworkConditions](./puppeteer.predefinednetworkconditions.md) | A list of network conditions to be used with [Page.emulateNetworkConditions()](./puppeteer.page.emulatenetworkconditions.md). | | [puppeteer](./puppeteer.puppeteer.md) | | ## Type Aliases | Type Alias | Description | | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | [ActionResult](./puppeteer.actionresult.md) | | | [Awaitable](./puppeteer.awaitable.md) | | | [AwaitableIterable](./puppeteer.awaitableiterable.md) | | | [ChromeReleaseChannel](./puppeteer.chromereleasechannel.md) | | | [ConsoleMessageType](./puppeteer.consolemessagetype.md) | The supported types for console messages. | | [ElementFor](./puppeteer.elementfor.md) | | | [ErrorCode](./puppeteer.errorcode.md) | | | [EvaluateFunc](./puppeteer.evaluatefunc.md) | | | [EvaluateFuncWith](./puppeteer.evaluatefuncwith.md) | | | [EventType](./puppeteer.eventtype.md) | | | [ExperimentsConfiguration](./puppeteer.experimentsconfiguration.md) |Defines experiment options for Puppeteer.
See individual properties for more information.
| | [FlattenHandle](./puppeteer.flattenhandle.md) | | | [HandleFor](./puppeteer.handlefor.md) | | | [HandleOr](./puppeteer.handleor.md) | | | [Handler](./puppeteer.handler.md) | | | [InnerParams](./puppeteer.innerparams.md) | | | [InterceptResolutionStrategy](./puppeteer.interceptresolutionstrategy.md) | | | [KeyInput](./puppeteer.keyinput.md) | All the valid keys that can be passed to functions that take user input, such as [keyboard.press](./puppeteer.keyboard.press.md) | | [LowerCasePaperFormat](./puppeteer.lowercasepaperformat.md) | | | [MouseButton](./puppeteer.mousebutton.md) | | | [NodeFor](./puppeteer.nodefor.md) | | | [PaperFormat](./puppeteer.paperformat.md) | All the valid paper format types when printing a PDF. | | [Permission](./puppeteer.permission.md) | | | [Product](./puppeteer.product.md) | Supported products. | | [ProtocolLifeCycleEvent](./puppeteer.protocollifecycleevent.md) | | | [PuppeteerLifeCycleEvent](./puppeteer.puppeteerlifecycleevent.md) | | | [PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md) | Utility type exposed to enable users to define options that can be passed topuppeteer.launch
without having to list the set of all types. |
| [ResourceType](./puppeteer.resourcetype.md) | Resource types for HTTPRequests as perceived by the rendering engine. |
| [TargetFilterCallback](./puppeteer.targetfiltercallback.md) | |