Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
class PuppeteerDeno
extends Puppeteer
import { PuppeteerDeno } from "https://deno.land/x/pptr@1.2.0/src/PuppeteerDeno.ts";

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 require('puppeteer') (or the equivalent ES import).

Examples

The following is a typical example of using Puppeteer to drive automation:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();

Once you have created a page you have access to a large API to interact with the page, navigate, or find certain elements in that page. The Page | page documentation lists all the available methods.

Constructors

new
PuppeteerDeno(settings: { preferredRevision: string; productName?: Product; } & CommonPuppeteerSettings)

Properties

private
__productName: Product
private
_lazyLauncher: ProductLauncher
readonly
_launcher: ProductLauncher
_preferredRevision: string
_productName: Product
readonly
product: string

The name of the browser that is under automation ("chrome" or "firefox")

Methods

connect(options: ConnectOptions): Promise<Browser>

This method attaches Puppeteer to an existing browser instance.

defaultArgs(options?: ChromeArgOptions): string[]
executablePath(): string
launch(options:
& { product?: Product; extraPrefsFirefox?: Record<string, unknown>; }
): Promise<Browser>

Launches puppeteer and launches a browser instance with given arguments and options when specified.