cannot bypass Cloudflare
For the new version, when I set headless=True, I cannot bypass Cloudflare, but when I set it False, it bypass successful.
Duplicate of https://github.com/seleniumbase/SeleniumBase/issues/3820#issuecomment-2973786318 / https://github.com/seleniumbase/SeleniumBase/discussions/3161#discussioncomment-10726235.
UC Mode and CDP Mode don't support headless mode because those use PyAutoGUI for lots of things, and PyAutoGUI doesn't work with a headless browser. (Headless mode isn't needed on Linux because of the special virtual display included.)
To activate the special virtual display, use xvfb=True on Linux to run headed browsers in a GUI-less environment.
If you encounter a CF CAPTCHA that isn't automatically bypassed, use sb.uc_gui_click_captcha() to get through.
Even if not using PyAutoGUI during UC Mode / CDP Mode, a headless browser can still leave a detectable fingerprint.
Note that SeleniumBase already gives you an optimal user agent by default, so unless you know exactly which other agents are valid to use, you'll likely get detected when trying to change it.
The headless fingerprint issue is real. Even with xvfb the CDP leak is still there in some builds. I ended up running a custom Chromium in a Docker container with NoVNC so I can actually see what's happening remotely — headless was causing me more problems than it solved. The fingerprint surface is just smaller when you're running a real headed environment.
One thing I noticed: a lot of Cloudflare challenges aren't really about behavior, they're checking canvas, WebGL, audio context — stuff that headless Chrome exposes differently. I patched some of those via JS hooks for a while but it's never as clean as having them handled at the binary level.
If anyone's curious, I've been using stealthbrowser.org as the base image. Their Chromium build strips a lot of those signals natively. I actually wrote some JS on top to customize the fingerprint seeds myself instead of paying per profile — works decent enough for my use case, though obviously not as thorough as their built-in implementation.