crawlee icon indicating copy to clipboard operation
crawlee copied to clipboard

Remove browserPoolOptions from BasicCrawler constructor

Open janbuchar opened this issue 5 months ago • 4 comments

  • brought up by @barjin in https://github.com/apify/crawlee/pull/3669#discussion_r3362911816
  • parallel to https://github.com/apify/crawlee/pull/3499#discussion_r2954892820
  • it's better to explicitly accept a pre-instantiated browser pool with non-default options than having two ways of passing it in

janbuchar avatar Jun 10 '26 08:06 janbuchar

@janbuchar Hi! I'm interested in working on this issue. I've reviewed the description and the related discussions. If no one is currently working on it, I'd be happy to submit a PR.

yuvrajsingh2428 avatar Jun 12 '26 04:06 yuvrajsingh2428

Hi @yuvrajsingh2428, thanks for reaching out before opening a PR, it's much appreciated! We are willing to accept a PR from an external contributor, provided that:

  1. You align with us (here) on how to resolve the problem with PlaywrightCrawler and PuppeteerCrawler (not sure about stagehand now) using browserPoolOptions to configure the browser type option to BrowserCrawler. This is a non-negligible architectural decision.
  2. Your PR targets the v4 branch 🙂

janbuchar avatar Jun 12 '26 08:06 janbuchar

Hi @janbuchar, thanks for the clarification!

My understanding is that the goal is to remove browserPoolOptions entirely and encourage users to pass a pre-instantiated browserPool when custom configuration is needed.

For PlaywrightCrawler and PuppeteerCrawler, would the intended behavior be:

  • if browserPool is provided, use it directly;
  • otherwise, create an internal default BrowserPool with the appropriate plugin/browser type (Playwright or Puppeteer);

so that browser selection is no longer configured via browserPoolOptions?

Does that align with the direction you have in mind before I start implementing it on the v4 branch?

yuvrajsingh2428 avatar Jun 13 '26 10:06 yuvrajsingh2428

My understanding is that the goal is to remove browserPoolOptions entirely and encourage users to pass a pre-instantiated browserPool when custom configuration is needed.

Correct

For PlaywrightCrawler and PuppeteerCrawler, would the intended behavior be:

* if `browserPool` is provided, use it directly;

* otherwise, create an internal default `BrowserPool` with the appropriate plugin/browser type (Playwright or Puppeteer);

so that browser selection is no longer configured via browserPoolOptions?

I believe that would work, provided that you make sure the browser pool yields the correct Page type on the type level.

Does that align with the direction you have in mind before I start implementing it on the v4 branch?

I think so! If you have no further questions, feel free to open a PR.

janbuchar avatar Jun 15 '26 07:06 janbuchar