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

Use puppeteer to enter password on website that has Dynamic numpad virtual keyboard in nodejs

I came across a website which I was only able to enter a password in the security control that popped up. How to solve this problem using Puppeteer? Below is my code: const puppeteer = require('puppeteer'); const url = 'xxxx'; async function…
homerqq
  • 21
  • 2
2
votes
0 answers

Puppeteer "Failed to launch the browser process!" when launching multiple browsers

I'm trying to launch multiple instances of browser to handle my tasks simultaneously. To illuminate I used the following code: export async function play() { const b1 = await launchBrowserPuppeteer() const b2 = await…
Positivity
  • 5,406
  • 6
  • 41
  • 61
2
votes
2 answers

Why isn't Puppeteer page.click waiting (maybe Browserless?)

Goal: I have a page that I need to get html from after first clicking something on the page. Issue: The html that comes back is not waiting for that element click. Here's one way that I've tried to do it. await page.setViewport({width: 1400, height:…
dizzy
  • 1,177
  • 2
  • 12
  • 34
2
votes
2 answers

Problems with element.click() in puppeteer

I got following Problem. If I run this code I get this error message and I cant seem to fix it. Uncaught Error Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'click') at _evaluateInternal…
NMG
  • 21
  • 2
2
votes
2 answers

How do I expose an object with a bunch of functional definitions (or methods) to puppeteer?

Question How do I expose an object with a bunch of methods to puppeteer? I am trying to retain the definition of the parent object and method (i.e. foo.one) within page.evaluate, if possible. In other words, I am looking for…
jmtornetta
  • 85
  • 6
2
votes
0 answers

get tabId from Puppeteer when new tab is created

I'm testing a Chrome extensions and in order to setup everything correctly I would like to know the tabId when a new tab is created const browser = await puppeteer.launch({ ... }); const appPage = await browser.newPage(); await…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
2
votes
0 answers

Generating a PDF from HTML using Puppeteer duplicates content

I've noticed when generating a PDF from HTML using puppeteer, it's sometimes duplicating the bottom content on the next page.. e.g. you can see here the table header is repeated on the next page. I've checked the HTML, and it definitely doesn't…
magician11
  • 4,234
  • 6
  • 24
  • 39
2
votes
0 answers

`puppeteer-page-proxy` with `https` has Error: net::ERR_FAILED or RFC 6066 error

I use puppeteer and puppeteer-page-proxy proxy. I don't have problem with use args: ['--proxy-server=socks5://127.0.0.1:9150',... with either http and https. I don't have problem with useProxy method and http website. I just have problem with …
Nabi K.A.Z.
  • 9,887
  • 6
  • 59
  • 81
2
votes
0 answers

How to using querySelector under querySelectorAll in Puppeteer?

I want scrape data from one website from listing. My code: const listing = await page.evaluate(() => { Array.from( document.querySelectorAll( "#__next > div> main > div> div > div > div > div > ul > li " ), …
robokonk
  • 101
  • 1
  • 5
2
votes
0 answers

Serverless Function looking for node_modules inside function directory instead of node_modules directory

I have created a serverless function for generating PDF, and I am using chrome-aws-lambda with puppeteer-core. But when I call chromium.puppeteer.launch, it throws following error: Cannot find module…
2
votes
1 answer

Puppeteer scrape value generated in javaScript

How do I scrape a value that is generated within Javascript. I have been trying to figure this out for a few days and now I'm stuck. I have the page login stuff working. The page looks like this in a browser and I want to extract the SoC% value and…
David P
  • 411
  • 7
  • 21
2
votes
1 answer

How can I add a css class to an element with Puppeteer

tried code below returned Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'add'). The class 'form-control' is on all inputs const forms = ".form-control"; if (device.name === "Panel") { await page.evaluate((s)…
Rob Foggo
  • 21
  • 3
2
votes
0 answers

Puppeteer Chromium not fully functional when spawned from Electron app

I'm new to this so please bare with me. I made a simple app for scraping some review data that I needed for work which uses puppeteer and chalk and is fully functional in this way. The code for the functional puppeteer version is as follows: const…
fleazy
  • 33
  • 3
2
votes
1 answer

Puppeteer select element id where beginning and end are dynamically generated

I'm trying to use puppeteer to select a dynamic element id. I've found how to select and element using just the beginning or just the end, but what I'm currently trying to do is find the element by the static part of the id in the center. await…
tniles320
  • 33
  • 6
2
votes
0 answers

Puppeteer nodejs project keeps freezing

I have a nodejs project running puppeteer v13.5.1 which does some webscraping. After some time (mostly 40-80 minutes) the process freezes without throwing any error. It just stops. I've added some logs and the strange thing is it happens on…
F.H.
  • 1,456
  • 1
  • 20
  • 34
1 2 3
99
100