Replies: 1 comment 1 reply
-
|
Thanks for the detailed write-up. The most likely cause is accumulated CDP (Chrome DevTools Protocol) traffic in the long-lived Celery browser session. Two things to change first:
If Turnstile still shows the checkbox after those changes, use the keyboard approach instead of clicking it: await asyncio.sleep(3) # let Turnstile widget initialize
await page.keyboard.press("Tab")
await asyncio.sleep(0.5)
await page.keyboard.press("Space")This has been confirmed working by multiple users in Docker and headless environments (#53, #79). Keyboard events don't go through the CDP mouse dispatch path that Turnstile detects. The core difference between your standalone script and Celery is that the standalone script launches, navigates immediately, and exits — minimal CDP footprint. The Celery worker keeps the browser alive across tasks, and the idle CDP connection generates background protocol traffic that degrades Turnstile's trust score. Let us know if that helps. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been stuck on this for a while and wanted to document it properly in case others run into the same thing :)
My Setup
I'm using CloakBrowser (persistent context) with login to a portal that uses Cloudflare Turnstile. The backend is Django with Celery workers handling the browser automation tasks.
What works
What does not work
The Celery task calls into this registry, gets a page, runs the login flow. Everything is structurally identical to the standalone script except the execution context.
What the logs show
On the very first task after a fresh Celery startup, no prior sessions, no reuse happening yet:
The page navigates to the portal, gets redirected to login, and then hangs. The timeout is because Turnstile is showing the checkbox and keeping the page in an active network state waiting for interaction. If you manually click the checkbox it passes and login works fine, so Turnstile is not hard-blocking, just not auto-passing.
I have tried
Has anyone seen Turnstile scoring behave differently based on how the browser process was spawned or what process context it runs in? Is there something CloakBrowser sets up differently when launched from an interactive terminal vs a background worker process that could affect how Turnstile evaluates the session?
Any insight into what signals Turnstile might be picking up differently between these two environments would be really helpful.
Beta Was this translation helpful? Give feedback.
All reactions