Remove browserPoolOptions from BasicCrawler constructor
- 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 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.
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:
- You align with us (here) on how to resolve the problem with
PlaywrightCrawlerandPuppeteerCrawler(not sure about stagehand now) usingbrowserPoolOptionsto configure the browser type option toBrowserCrawler. This is a non-negligible architectural decision. - Your PR targets the
v4branch 🙂
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
browserPoolis provided, use it directly; - otherwise, create an internal default
BrowserPoolwith 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?
My understanding is that the goal is to remove
browserPoolOptionsentirely and encourage users to pass a pre-instantiatedbrowserPoolwhen custom configuration is needed.
Correct
For
PlaywrightCrawlerandPuppeteerCrawler, 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
v4branch?
I think so! If you have no further questions, feel free to open a PR.