Skip to content

Conversation

mdmintz
Copy link
Member

@mdmintz mdmintz commented Oct 8, 2025

CDP Mode: Patch 63


For Pure CDP Mode (sb_cdp), we're adding the ability to set options via command-line args. Here's what to expect, with examples:

python SCRIPT.py --incognito
python SCRIPT.py --guest
python SCRIPT.py --headless
python SCRIPT.py --ad-block
python SCRIPT.py --agent="MY NEW USER AGENT"
python SCRIPT.py --geolocation="(31.774390, 35.222450)"
python SCRIPT.py --timezone=="Asia/Kolkata"
python SCRIPT.py --platform="MacIntel"
python SCRIPT.py --lang="fr"
python SCRIPT.py --proxy="USER:PASS@SERVER:PORT"
python SCRIPT.py --binary-location="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"

There are a few additional options on Linux, such as --gui/--headed, (which overrides the default Linux headless mode).
And there's --xvfb on Linux for the special virtual display (which may already be set by default if not using other options).

This aims to simplify option-handling, as you will no longer need to modify a script itself in order to change how it runs.

Note that all these options were already available via method args passed into sb_cdp.Chrome(). Method args always take priority over command-line options. For example, if you set the binary_location / browser_executable_path via method arg, but set a different one on the command-line, then the method arg takes priority.

@mdmintz mdmintz self-assigned this Oct 8, 2025
@mdmintz mdmintz added enhancement Making things better documentation dependencies This involves updating a dependency file tests This involves test updates or new tests SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Oct 8, 2025
@mdmintz mdmintz merged commit 4f2caff into master Oct 8, 2025
7 checks passed
@mdmintz mdmintz deleted the cdp-mode-patch-63 branch October 8, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies This involves updating a dependency file documentation enhancement Making things better SeleniumBase 4 SeleniumBase 4 tests This involves test updates or new tests UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make PyAutoGUI a required dependency on Linux Add command-line shortcuts for Pure CDP Mode (sb_cdp)

1 participant