feat: add chrome BrowserType for PlaywrightCrawler to use the Chrome browser#1487
feat: add chrome BrowserType for PlaywrightCrawler to use the Chrome browser#1487vdusek merged 4 commits intoapify:masterfrom
chrome BrowserType for PlaywrightCrawler to use the Chrome browser#1487Conversation
| ValueError, match=r'Cannot use `use_chrome` with `Configuration.default_browser_path` or `executable_path` set.' | ||
| ): | ||
| PlaywrightBrowserPlugin( | ||
| browser_type='chromium', |
There was a problem hiding this comment.
To me, this seems a little strange from the user perspective. It is defining one type of browser in one argument and then overriding it in another argument, which is valid only for a specific value of the first argument. I would prefer to just add browser_type=chrome and connect any logic to such a specific browser_type internally.
There was a problem hiding this comment.
Since browser_type in Crawlee is a parameter that directly corresponds to a similar parameter in Playwright, I think adding a new option to it will confuse users familiar with Playwright.
There was a problem hiding this comment.
I think that users familiar with Playwright are probably OK with the current state of defining channel in browser_launch_options - as that is the Playwright way of using Chrome and offers the best flexibility without us needing to change anything.
Experienced Playwright users aside, when considering anyone else, I think it is not a very intuitive way to select Chrome with this change.
Just consider the following snippets:
To use Firefox:
PlaywrightCrawler(browser_type="firefox")
But to use Chrome
PlaywrightCrawler(browser_type="chromium", use_chrome=True)
I think that most users would expect just this instead:
PlaywrightCrawler(browser_type="chrome")
Anyway, I do not have a very strong opinion about this, but I would suggest introducing new arguments only if we see big improvements in readability, which I do not think is the case now.
There was a problem hiding this comment.
Maybe @vdusek, @janbuchar have some ideas about which approach would be best to choose?
use_chrome to use the Chrome browserchrome BrowserType for PlaywrightCrawler to use the Chrome browser
Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>
vdusek
left a comment
There was a problem hiding this comment.
LGTM
We have quite a lot of "fix" open PRs, so let's wait for them at first, and release one more patch release. This will be part of v1.1, together with Redis.
Description
chromeBrowserTypeforPlaywrightCrawlerto use the Chrome browserIssues