seleniumbase / SeleniumBase

📊 Blazing fast Python framework for web crawling, scraping, testing, and reporting. Supports pytest. Stealth abilities: UC Mode and CDP Mode.
https://seleniumbase.io
MIT License
5.43k stars 982 forks source link

Param "expert" mode in sb_manager #3277

Closed menbre closed 2 days ago

menbre commented 2 days ago

Hi, there is no expert mod parameter in the sb manager, any other ways to prescribe it?

:param expert: When set to True, "expert" mode is enabled. This adds: --disable-web-security --disable-site-isolation-trials, as well as some scripts and patching useful for debugging. (For example, ensuring shadow-root is always in "open" mode.)

mdmintz commented 2 days ago

The parameter is there:

https://github.com/seleniumbase/SeleniumBase/blob/d8d02cd4740e700ef6ea3b133bbdc9830e728cf4/seleniumbase/undetected/cdp_driver/cdp_util.py#L154

It can be used by the formats that launch CDP directly: (via cdp_driver.cdp_util.start_sync() args). Eg:

https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_cdp.py

https://github.com/seleniumbase/SeleniumBase/blob/d8d02cd4740e700ef6ea3b133bbdc9830e728cf4/examples/cdp_mode/raw_cdp.py#L13

It's not part of SB() Manager directly because using that option makes SB detectable.