Questions tagged [puppeteer-cluster]

puppeteer-cluster manages a pool of headless browsers via puppeteer. This is useful to crawl multiple pages in parallel or to keep a pool of open browsers.

puppeteer-cluster creates a pool of puppeteer workers by spawning multiple browsers, contexts or pages via puppeteer. The library keeps track of queued jobs and handles thrown errors. In addition, it allows to retry jobs or introduce delays when crawling a domain.

Resources:

73 questions
2
votes
2 answers

Puppeteer cluster example throwing Error: Unable to get browser page

I'm using this example in the puppeteer-cluster docs I am running this on node v10.15.3 I have attempted passing the headless property and slowMo to puppeteer options. I would expect the code to log out and create a Screenshot of the page however,…
Moshie
  • 95
  • 1
  • 11
2
votes
2 answers

Puppeteer (Cluster) closing page when I interact with it

In a NodeJS v10.x.x environment, when trying to create a PDF page from some HTML code, I'm getting a closed page issue every time I try to do something with it (setCacheEnabled, setRequestInterception, etc...): async (page, data) => { try { …
rmartrenado
  • 1,516
  • 1
  • 18
  • 42
1
vote
0 answers

Puppeteer cluster launches blank chrome tabs

I am facing an issue with Puppeteer-cluster launching additional chrome black blank pages, even though the puppeteer itself is headless: true. I wonder if I can prevent this behaviour? Or maybe the blank pages won't be shown when the app will be…
I B
  • 11
  • 1
1
vote
0 answers

why can't i get the button element? and I've tried various ways to get it

I'm so exhausted I've tried many ways to get selected but everything I've tried failed. code html and i have tried starting from await…
1
vote
1 answer

ProtocolError: Protocol error (Runtime.callFunctionOn): Target closed. - express.js and puppeteer-cluster

I want to iterate over key-pairs of data.extractRules and get elements data from the page. This snippet inside forEach loop is causing app crashes. I tried hardcoding key and cssSelector and tried this outside of forEach loop and it worked. …
Kosaaaaa
  • 115
  • 4
  • 7
1
vote
1 answer

Unable to download multiple files parallelly in different tabs of puppeteer browser

I want to download multiple files by opening multiple tabs by loop and downloading the file from each tab separately but it is only downloading a file of the last tab in a different download path. Here is a sample code that is failing to download…
1
vote
0 answers

Running multiple tests with Jest and Puppeteer

I have 2 test examples and when I run them both at once it seems that there is no time to execute them both till end. When I run them separately, they go through till the end. I've read that Puppeteer-cluster can help out running multiple tests at…
Angelov
  • 51
  • 5
1
vote
1 answer

How to use the same puppeteer-cluster task across different files?

Saw plenty of examples of puppeteer-cluster and how to instantiate it/create tasks by reading the documentation in its GitHub page, yet I can't still figure out how to import the same instance of puppeteer-cluster across different files of my…
Sergio Palmeiras
  • 221
  • 4
  • 13
1
vote
0 answers

how to get WSendpoint of a puppeteer-cluster browser

in a project that requires: Starting each session with logging in credentials + notification/OTP work with multiple accounts asynchronously remote debugging or monitoring of the session 5+ different operations can be requested on a open session ,…
aypar
  • 11
  • 2
1
vote
0 answers

Puppeteer - Unable to launch more than 2 browsers

Hi I have a simple puppeteer script that uses a different userDataDir per instance. I'm unable to spawn more than 2 instances of puppeteer. Here's the code: ipcMain.on('request-mainprocess-action', (event, arg) => { var taskData = arg[0]; …
SunAwtCanvas
  • 1,261
  • 1
  • 13
  • 38
1
vote
0 answers

How to write Puppeteer test for Typeform?

I need test Typeform submission. But when I try to click on element it give error: UnhandledPromiseRejectionWarning: TimeoutError: Navigation timeout of 30000 ms exceeded await page.waitForSelector(...) await page.click(...) await…
1
vote
1 answer

Correct way to pass args in puppeteer-cluster via puppeteerOptions

I am trying to use args in my code to use a proxy service I have. If I remove the args altogether things run fine but if I have them in there I get an error stating: Error: Unable to restart chrome. I checked multiple examples and copied the same to…
Tom
  • 251
  • 1
  • 6
  • 16
1
vote
1 answer

Run multiple puppeteer executions with puppeteer-cluster

How do you run multiple concurrent executions with puppeteer-cluster? I have 5 as max concurrency, but doing await cluster.execute() only runs 1 at a time. const cluster = await Cluster.launch({ monitor: false, concurrency:…
1
vote
1 answer

How to save a canvas as an image using puppeteer?

I'm trying to load a page with a canvas and then save it as an image. For example, this page. On Chrome, I can right click the canvas with a circle on the upper right side of the page and click save image. I want to do this exact same thing but…
Lorenzo Ang
  • 1,202
  • 3
  • 12
  • 35
1
vote
0 answers

Should I close page in puppetter cluster task closure when using long lasting cluster

I have a cluster for which I have defined a task. As per example in the README.md, I have a closure which accepts a page instance as an argument. I navigate to the page and capture a screenshot. I don't do anything else with the page instance. In…
porkbrain
  • 720
  • 5
  • 16