Questions tagged [puppeteer]

Puppeteer is a Node.js library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.

Puppeteer is a Node.js library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium. You can also use Puppeteer with Firefox Nightly (experimental support).


Puppeteer is mostly used for:

  1. Generate screenshots and PDFs of pages.
  2. Crawl an SPA and generate pre-rendered content (i.e. "SSR").
  3. Scrape content from websites.
  4. Automate form submission, UI testing, keyboard input, etc.
  5. Create an up-to-date, automated testing environment. Run your tests directly in the latest version of Chrome using the latest JavaScript and browser features.
  6. Capture a timeline trace of your site to help diagnose performance issues.

Resources:

Books:

7753 questions
2
votes
1 answer

puppeteer Error Unknown key: " " when trying to press space key

I was trying to make a fun project by automating a typing test using puppeteer, but when I want to press space this error pops up D:\scraping\puppeteer tut\node_modules\puppeteer\lib\cjs\puppeteer\common\assert.js:28 throw new…
2
votes
3 answers

Puppeteer: TypeError: Readable is not a constructor

I have been trying to use Puppeteer@15.5.0 to generate a PDF on the server side in Node.js. import { launch } from 'puppeteer'; ... const browser = await launch(); const page = await browser.newPage(); await page.setContent('COME…
Ehsan Kazi
  • 388
  • 3
  • 8
2
votes
1 answer

puppeteer on Lambda

I want to use puppeteer on Lambda to convert HTML to PDF. With the chrome-aws-lambda module or the puppeteer module, I'm trying to run (sam local invoke) a function that calls puppeteer.launch(), but the function returns an error. If anyone is…
kusumoto_teruya
  • 2,415
  • 4
  • 23
  • 38
2
votes
3 answers

Error: Failed to launch the browser process! Whatsapp web js | Azure Portal Linux puppeteer

I am trying to use Whatsapp web js and it's working fine in my localhost but when I am trying to push in Azure Linux Hosting, I am getting this error. /node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241 …
BJ Coder
  • 350
  • 5
  • 16
2
votes
0 answers

Unable to install puppeteer

I have written the command npm i --location=global puppeteer to install puppeteer. writing npm install -g puppeteer also produce the same error: C:\windows\system32>npm install -g puppeteer npm ERR! code 1 npm ERR! path C:\Users\NITU…
2
votes
0 answers

Failed to launch the browser process!\n/tmp/chromium: error while loading shared libraries: libnss3.so Vercel

When I try to run Next js API on production Vercel I get this error Failed to launch the browser process!\n/tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or…
AmelDev
  • 79
  • 1
  • 6
2
votes
1 answer

How to scrape multiple pages with puppeteer

I'm trying to scrape prices from multiple pages using puppeteer. What i'm having trouble with, is to write a single JSON file with all the scraped data. The problem is that if i try to write the file with the variables from inside the async…
Fadrick
  • 69
  • 8
2
votes
0 answers

Unable to load script on puppeteer AWS Lambda

Im trying to add an external javascript file to puppeteer on Lambda. const chromium = require('chrome-aws-lambda'); const browser = await chromium.puppeteer.launch({ .... }); const webPage = await browser.newPage(); await webPage.goto(url, {…
Nuwan.Niroshana
  • 407
  • 4
  • 15
2
votes
0 answers

Open DevTools with Puppeteer on the Console tab by default

I'm using puppeteer for my E2E testing on Linux/Mac. Works like a charm, but for debugging purposes I would like to use DevTools. I start the browser as follows const browser = await puppeteer.launch({ ignoreHTTPSErrors: true, headless:…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
2
votes
1 answer

Using Jest with Puppeteer : EReferenceError : xxx is not defined

when learn puppeteer/jest, many tutorial articles example are the same,like: const timeout = 10000; beforeAll(async () => { await page.goto(URL, { waitUntil: "domcontentloaded" }); }); describe("Test title and header of the homepage", () => { …
2
votes
1 answer

Merge multiple puppeteer pdf buffers from urls into single pdf file and return to user

I am trying to merge multiple, infinite amount, of pdf buffers from puppeteer to a single file. I suspect it has something to do with the buffer, but I have yet to find a solution that seems to work. This got me the closest, How to output a PDF…
2
votes
1 answer

Error: Evaluation failed: ReferenceError: _0x5b9d0e is not defined,after using javascript-obfuscator

I can successfully run the code below, But failed after obfuscating with javascript-obfuscator. const puppeteer = require('puppeteer-core'); let params = { ignoreHTTPSErrors: true, args: [ '--ignore-certificate-errors', '--no-sandbox', …
Homer Qing
  • 21
  • 1
2
votes
2 answers

How to solve? ( Error: No element found for selector: )

const puppeteer = require('puppeteer'); const path = require('path'); const creds = { username: "abcde", password2: "12345", password1: "123456" }; (async() => { const browser = await puppeteer.launch({ headless: false, }); const…
Samet Kara
  • 21
  • 1
  • 2
2
votes
2 answers

Generating a PDF with form answers in NodeJs and send it by email

I'm on a personal project which is a simple form with many inputs to be filled. The last step is to confirmed the datas, once this is done, I would like to generate a PDF of the form answers and send it to an email that I asked for before (in the…
Charly
  • 65
  • 4
2
votes
1 answer

Puppeteer Headless Blocked by google with headless: false

I am using puppeteer to perform some action and to take screen shots. The entire process has multiple authentication, first Gmail login, then the SSO redirects to Microsoft and from them we get into the application. The problem that i am facing is,…