0

I want to use a remote headless browser service (this one) and in the docs they use puppeteer.connect() instead of puppeteer.launch()

this the code to launch the puppeteer cluster:

  const cluster = await Cluster.launch({
    concurrency: Cluster.CONCURRENCY_PAGE,
    maxConcurrency: 10,
    monitor: true,
    options: {
      timeout: 0,
    }
  });

how can I use puppeteer.connect() in puppeteer-cluster?

Anas Latique
  • 357
  • 5
  • 13
  • I suppose browserless.io have their own cluster for managing multiple puppeteer workers. You could use puppeteer-cluster if you expect to run puppeteer on your own machines. – Rasso Nov 22 '19 at 20:27
  • Reading through their docs, you just have to connect to their api and just keep sending requests and they will take care of handling multiple workers for performance. – Rasso Nov 22 '19 at 20:35
  • using Browserless.io is not a solution to this problem. – Peyter Jul 13 '20 at 02:14

1 Answers1

1

What is the use-case for connecting to an already open Chrome?

Puppeteer-cluster manages the whole operation of opening, closing the worker puppeteer browsers for you.

Look at this example I wrote, the syntax is correct, you can even copypasta it and use it yourself. The question is not really relevant to your query, but the code, you can use if you want, TD, the creator helped me come up with it.

enter link description here

Peyter
  • 474
  • 3
  • 14