Need help finding data-sitekey on sites that use cloudflare

Describe the problem/error/question

How do I extract the data-sitekey property on a site that uses Cloudflare Turnstile? I used the HTTP Request node and it doesn’t look like data-sitekey is visible on the page. I need to find data-sitekey so I can send it to 2captcha.com to solve captcha

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.7.5
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 24.04 LTS

Hi @Ruriko HTTP node only fetches raw data it got from the website, this data very likely contains the data-sitekey as most of the times you manually have to run javascript query in browser to get that key, specially in cloudflare they key is mostly hidden, this is not certain as you may get the site-key from some sites but most of the times the results would be empty. Using some other service to fetch that for you would be a good approach at scale.

Hi @Ruriko, welcome back!

I tried this on my end using the attached URL in your workflow, but I couldn’t even find it, It sounds tricky, either I’m missing something or Cloudflare is doing its bot-detection thing, I’m not really sure..

Since your goal is to get the website content that requires solving a CAPTCHA, and you asked for a solution, I would recommend using a browser-as-a-service like browserless.io, They include CAPTCHAs solving in their generous free plan, so you just need to call the BrowserQL endpoint:

https://production-sfo.browserless.io/stealth/bql

With a query like this:

{
  "query": "mutation { goto(url: \"{{ $json.url }}") { status } solve { solved } waitForTimeout(time: 8000) { time } html { html } }"
}

This should solve the CAPTCHA,

Here’s a test using your URL:

And here’s the example, just replace the token with your own:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.