Skip to content

C_f Challenge Fails in Headless Mode – Works in Headed Mode Only #3820

Closed
@softbomber

Description

@softbomber

I tried using the method

sb.activate_cdp_mode("https://....")
user_agent = sb.execute_script("return navigator.userAgent;")
sb.sleep(15)
sb.uc_gui_click_captcha()

to solve the Cloudflare challenge "Verify you are human by completing...".

I noticed that in headless mode, it doesn't work, but when using headed=True, everything works fine.
It was also observed that if you use a custom user-agent with headed=True, Cloudflare somehow detects that the browser is under automation control.

What should I do to solve this problem?

user_agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
sbase version: latest.

I also tried using the method sb.uc_gui_click_cf() with the same result

Metadata

Metadata

Assignees

No one assigned

    Labels

    UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeduplicateThe answer/solution already exists somewhereinvalid usageYou may need to change what you're doing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions