Socket
Socket
Sign inDemoInstall

@types/puppeteer-core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/puppeteer-core


Version published
Weekly downloads
189K
decreased by-3.15%
Maintainers
1
Install size
817 kB
Created
Weekly downloads
 

Package description

What is @types/puppeteer-core?

@types/puppeteer-core provides TypeScript type definitions for the puppeteer-core library, which is a tool for controlling headless Chrome or Chromium browsers programmatically.

What are @types/puppeteer-core's main functionalities?

Launching a Browser

This feature allows you to launch a headless browser instance. The code sample demonstrates how to launch a headless browser and then close it.

const puppeteer = require('puppeteer-core');
(async () => {
  const browser = await puppeteer.launch({ headless: true });
  console.log('Browser launched');
  await browser.close();
})();

Navigating to a Web Page

This feature allows you to navigate to a specific web page. The code sample demonstrates how to open a new page in the browser and navigate to 'https://example.com'.

const puppeteer = require('puppeteer-core');
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  console.log('Page loaded');
  await browser.close();
})();

Taking a Screenshot

This feature allows you to take a screenshot of a web page. The code sample demonstrates how to navigate to a web page and take a screenshot, saving it as 'example.png'.

const puppeteer = require('puppeteer-core');
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({ path: 'example.png' });
  console.log('Screenshot taken');
  await browser.close();
})();

Extracting Page Content

This feature allows you to extract the HTML content of a web page. The code sample demonstrates how to navigate to a web page and log its HTML content.

const puppeteer = require('puppeteer-core');
(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  const content = await page.content();
  console.log(content);
  await browser.close();
})();

Other packages similar to @types/puppeteer-core

Readme

Source

Installation

npm install --save @types/puppeteer-core

Summary

This package contains type definitions for puppeteer-core (https://github.com/GoogleChrome/puppeteer#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/puppeteer-core.

Additional Details

  • Last updated: Wed, 23 Dec 2020 21:10:00 GMT
  • Dependencies: @types/puppeteer
  • Global values: none

Credits

These definitions were written by Fumiaki Matsushima, and Tymur Kubai.

FAQs

Last updated on 23 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc