Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

puppeteer-core 21.10.0

A high-level API to control headless Chrome over the DevTools Protocol
Package summary
Share
0
issues
0
licenses
Package created
10 Aug 2018
Version published
29 Jan 2024
Maintainers
2
Total deps
0
Direct deps
0
License
Apache-2.0
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does puppeteer-core do?

Puppeteer-core is a Node.js library providing a high-level API to control Chrome or Chromium browsers over the DevTools Protocol. This powerful tool enables you to programmatically manipulate the browser to automate tasks such as form submissions, UI testing, PDF and screenshot generation, server-side rendering for Single-Page Applications (SPAs), and much more. To ensure seamless operation, puppeteer-core doesn't make assumptions about any defaults and will not download Chrome or any other browser upon installation.

How do you use puppeteer-core?

Using puppeteer-core in your JavaScript project conveniently affords you the power of full browser automation. First, start by installing puppeteer-core in your project using npm:

npm i puppeteer-core

Once installed, you can start utilizing its functions. Here is a brief example of how to use puppeteer-core to automate a task:

const puppeteer = require('puppeteer-core');

(async () => {
  const browser = await puppeteer.launch({executablePath: '/path/to/Chrome'});
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({path: 'example.png'});
  await browser.close();
})();

In this example, we first import the puppeteer-core library. We then launch the browser, open a new page, navigate to an example website, take a screenshot of the page, and finally close the browser.

Remember, for puppeteer-core, you need to provide the path to the browser executable in the launch method. The above example also implies that you have already installed a compatible browser in your system.

Where are the puppeteer-core docs?

You can explore the rich features of puppeteer-core further by accessing its complete documentation and API at https://pptr.dev/api. This site provides comprehensive guides, usage examples, and a helpful FAQ section to assist you in making the most of this powerful browser automation library.