Skip to content

feat: locale agnostic cloudflare captcha solver - #412

Closed
subediparas5 wants to merge 1 commit into
D4Vinci:mainfrom
subediparas5:feat/locale-agnostic-cloudflare-solver
Closed

feat: locale agnostic cloudflare captcha solver#412
subediparas5 wants to merge 1 commit into
D4Vinci:mainfrom
subediparas5:feat/locale-agnostic-cloudflare-solver

Conversation

@subediparas5

@subediparas5 subediparas5 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Proposed change

This PR makes Cloudflare challenge solving language-independent for both synchronous and asynchronous stealth sessions. Fixes #411.

The solver previously relied on English text such as <title>Just a moment...</title> and Verifying you are human.. Localized challenges, such as French pages using <title>Un instant…</title>, could therefore be incorrectly treated as solved before the checkbox was clicked.

The updated implementation:

  • Uses Scrapling’s existing Cloudflare challenge detector instead of translated page text.
  • Locates non-embedded Turnstile widgets through input[name="cf-turnstile-response"].
  • Clicks the checkbox using the widget container’s bounding box.
  • Preserves existing embedded Turnstile behavior.
  • Applies the fix to both sync and async solvers.
  • Includes a regression test for a localized challenge page.

Type of change:

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Additional information

  • This PR fixes or closes an issue: fixes #<ISSUE_NUMBER>
  • This PR is related to an issue: #
  • Link to documentation pull request: **

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doc-strings.

@subediparas5

Copy link
Copy Markdown
Contributor Author

@D4Vinci can you look into this, I am using scrapling on one of my project and this is impacting there. Currently I have monkeypatched this but it would be better if i didnt need monkeypatching.

@D4Vinci

D4Vinci commented Aug 17, 2026

Copy link
Copy Markdown
Owner

@subediparas5 Can you share a list of websites with the problem?

@subediparas5

Copy link
Copy Markdown
Contributor Author

@D4Vinci

D4Vinci commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Sorry for the delay; I had to find some free time to look into this.

This issue is invalid; the website is French, but all Cloudflare sentences are English as they always were. The CAPTCHA and the website title are still English, so I don't know why you are trying to remove them. Below is a screenshot of the current version solving it three times in a row without issues.

Screenshot 2026-08-18 at 11 56 13 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Cloudflare Turnstile solving locale-independent

2 participants