Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

puppeteer-pro

Package Overview
Dependencies
Maintainers
0
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-pro

A simple puppeteer wrapper to enable useful plugins with ease

  • 1.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
49
Maintainers
0
Weekly downloads
 
Created
Source

Puppeteer-Pro

A simple puppeteer wrapper to enable useful plugins with ease

Installation

Requires node v10 and higher

npm install puppeteer-pro

Quickstart

Puppeteer-Pro can do all the same things as puppeteer, just now with plugins!

// Puppeteer-Pro is a drop-in replacement for puppeteer
const PuppeteerPro = require('puppeteer-pro');

// Enable the 'avoidDetection' plugin to prevent headless detection
PuppeteerPro.avoidDetection();

// Enable the 'solveRecaptchas' plugin to solve Google's recaptchas (remember to provide a wit.api API access token)
const solver = PuppeteerPro.solveRecaptchas('WIT_AI_ACCESS_TOKEN');

(async () => {
  const browser = await PuppeteerPro.launch();
  const page = await browser.newPage();
  
  console.log('Testing the 🐱‍👤 avoidDetection 🐱‍👤 plugin..')
  await page.goto('https://arh.antoinevastel.com/bots/areyouheadless');
  await page.screenshot({ path: 'are-you-headless.png' });
  
  console.log('Testing the recaptcha solver..')
  await page.goto('https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php');
  await solver.waitForCaptcha(page); // Captcha script is deferred, so will load after page.goto completes
  await solver.solveRecaptcha(page);
  await page.screenshot({ path: 'is-recaptcha-solved.png' });

  await browser.close();
})();

Passive Improvements

  • There can be multiple request interception handlers for the same request. In such cases, the resulting response will prioritize respond, followed by abort, followed by continue. For example:
    • If amongst 5 handlers, respond is called 1 time, abort is called 2 times and continue is called 2 times, the result will be respond. This will occur after the first respond is called and not when all handlers are finished.
    • If amongst 5 handlers, abort is called 1 time and continue is called 4 times, the result will be abort. This will occur after all handlers are finished.
    • If amongst 5 handlers, all handlers call continue, the result will be continue. This will occur after all handlers are finished.

Optional Built-in Plugins

Anonymize User Agent

  • Anonymize the user-agent across all pages

Avoid Detection

  • Multiple techniques to combat headless browser detection

Block Resources

  • Block any resource type from loading
  • Can be used to speed up loading websites by blocking style sheets and images

Disable Dialogs

  • Block dialogs from popping up and stopping execution

Manage Cookies

  • Save and load cookies across sessions
  • Supports multiple profiles and switching between profiles

Manage Local Storage

  • Save and load local storage across sessions
  • Supports multiple profiles and switching between profiles

Solve Recaptcha

  • Solve Google's reCAPTCHA v2
  • Requires a FREE wit.ai access token

Keywords

FAQs

Package last updated on 12 Sep 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc