Turnstile-Solver icon indicating copy to clipboard operation
Turnstile-Solver copied to clipboard

Invalid Turnstile solutions

Open ijnrghjkdsmigywneig203 opened this issue 4 months ago • 21 comments

Hi,

All turnstile solutions currently being generated from all browsers are not useable, this may be true for a more elevated version of turnstile that does not require additional data.

Thank you

ijnrghjkdsmigywneig203 avatar Aug 25 '25 19:08 ijnrghjkdsmigywneig203

Facing the same issue from yesterday.

mayurv123 avatar Aug 26 '25 14:08 mayurv123

Turnstile has added rate limiting so each user can only generate a limited number of tokens within a specific time period. For now I provide a paid solution that works well. Unfortunately, I don’t have the time to maintain an open-source option due to university and personal commitments.

Theyka avatar Aug 26 '25 19:08 Theyka

I've solved it. I've made a fork for that project that solves this problem. https://github.com/xLuckySzx/Turnstile-Solver I didn't test it thoroughly, but it seems to work @ijnrghjkdsmigywneig203 @mayurv123

xLuckySzx avatar Aug 29 '25 19:08 xLuckySzx

Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@id='cf-turnstile']"

mayurv123 avatar Aug 30 '25 04:08 mayurv123

Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@id='cf-turnstile']"

What website are you trying to scrape? So that O can give it a Quick Look when I have some time

xLuckySzx avatar Aug 30 '25 07:08 xLuckySzx

Anyways the reason why the challenges are not being solved correctly anymore is simply because the old version only loaded an HTML template containing the turnstile form. Instead, now you need to load the whole website, as you need to load some data from cf to solve it correctly

xLuckySzx avatar Aug 30 '25 07:08 xLuckySzx

@xLuckySzx I was trying on https://new25.gdtot.dad/file/4851139537

mayurv123 avatar Aug 30 '25 07:08 mayurv123

Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@id='cf-turnstile']"

What website are you trying to scrape? So that O can give it a Quick Look when I have some time

same error solving [14:57:04] [DEBUG] -> Exception while waiting for response: Page.input_value: Timeout 2000ms exceeded. Call log: 2 × waiting for locator("[name=cf-turnstile-response]")

devslengkak avatar Aug 30 '25 07:08 devslengkak

The problem was that the website you were using had a different container for the captcha.

I have modified the code so that /turnstile is a POST endpoint and accepts

{ "url": "https://new25.gdtot.dad/file/4851139537", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@class='cf-turnstile']" }

curl -X POST http://localhost:5000/turnstile -H "Content-Type: application/json" -d "{"url": "https://new25.gdtot.dad/file/4851139537", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@class='cf-turnstile']"}"

Tested on that website and it works. You need to set cf_selector according to website's structure. I don't know if there's a better way or more transparent way of detecting CF container. If someone want to look into it

xLuckySzx avatar Aug 30 '25 10:08 xLuckySzx

I've solved it. I've made a fork for that project that solves this problem. https://github.com/xLuckySzx/Turnstile-Solver I didn't test it thoroughly, but it seems to work @ijnrghjkdsmigywneig203 @mayurv123

not working sir

henzycuong1 avatar Aug 31 '25 02:08 henzycuong1

The problem was that the website you were using had a different container for the captcha.

I have modified the code so that /turnstile is a POST endpoint and accepts

{ "url": "https://new25.gdtot.dad/file/4851139537", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@Class='cf-turnstile']" }

curl -X POST http://localhost:5000/turnstile -H "Content-Type: application/json" -d "{"url": "[https://new25.gdtot.dad/file/4851139537](https://new25.gdtot.dad/file/4851139537%5C)", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@Class='cf-turnstile']"}"

Tested on that website and it works. You need to set cf_selector according to website's structure. I don't know if there's a better way or more transparent way of detecting CF container. If someone want to look into it

The generated token is still invalid

mayurv123 avatar Aug 31 '25 03:08 mayurv123

解決旋轉柵門時出錯:Page.eval_on_selector:找不到匹配選擇器“//div[@id='cf-turnstile']”的元素

您要抓取哪個網站?這樣 O 可以在我有時間時快速瀏覽一下

https://service.taipower.com.tw/ebpps2/login

eric2100 avatar Sep 01 '25 05:09 eric2100

The problem was that the website you were using had a different container for the captcha.

I have modified the code so that /turnstile is a POST endpoint and accepts

{ "url": "https://new25.gdtot.dad/file/4851139537", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@Class='cf-turnstile']" }

curl -X POST http://localhost:5000/turnstile -H "Content-Type: application/json" -d "{"url": "[https://new25.gdtot.dad/file/4851139537](https://new25.gdtot.dad/file/4851139537%5C)", "sitekey": "0x4AAAAAAADch0Ba3E6N-jTt", "cf_selector": "//div[@Class='cf-turnstile']"}"

Tested on that website and it works. You need to set cf_selector according to website's structure. I don't know if there's a better way or more transparent way of detecting CF container. If someone want to look into it

Hi, I’m still having problems with your fork, even after specifying the correct selector I get the wrong captcha solution like in this repo

69888 avatar Sep 04 '25 08:09 69888

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

elmoiv avatar Sep 04 '25 11:09 elmoiv

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

Are you sure about that? The code doesn't use closed shadow roots to interact with the challenge widget, but it simply clicks on the widget button. I haven't looked into it any longer because in my specific usecase it works now.

If you have a specific site you're looking to generate turnstile tokens and it still doesn't work type the url, so that I can test it if I have some spare time.

xLuckySzx avatar Sep 04 '25 12:09 xLuckySzx

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

Are you sure about that? The code doesn't use closed shadow roots to interact with the challenge widget, but it simply clicks on the widget button. I haven't looked into it any longer because in my specific usecase it works now.

If you have a specific site you're looking to generate turnstile tokens and it still doesn't work type the url, so that I can test it if I have some spare time.

If we are speaking about "Verifying you are human" turnstile. So the problem is that its rendered inside a shadow root that is closed. You can not access that or interact with it while using playwright See Here.

To overcome this you may simulate "Tab" and "Space" keyboard buttons to really click on the box. But 90% of the time will fail as cloudflare now uses algorithms to differ between human and automation interaction.

Even for paid solutions you need to inject pre-load js code to patch turnstile rendering in order to return required params for the solver backend to work correctly.

elmoiv avatar Sep 04 '25 14:09 elmoiv

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

Are you sure about that? The code doesn't use closed shadow roots to interact with the challenge widget, but it simply clicks on the widget button. I haven't looked into it any longer because in my specific usecase it works now.

If you have a specific site you're looking to generate turnstile tokens and it still doesn't work type the url, so that I can test it if I have some spare time.

error [22:22:06] [ERROR] -> Browser 1: Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@Class='cf-turnstile']"

devslengkak avatar Sep 04 '25 15:09 devslengkak

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

Are you sure about that? The code doesn't use closed shadow roots to interact with the challenge widget, but it simply clicks on the widget button. I haven't looked into it any longer because in my specific usecase it works now. If you have a specific site you're looking to generate turnstile tokens and it still doesn't work type the url, so that I can test it if I have some spare time.

error [22:22:06] [ERROR] -> Browser 1: Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@Class='cf-turnstile']"

If you provide the website you’re trying to access specifically I’ll give it a look when I have some free time

xLuckySzx avatar Sep 04 '25 15:09 xLuckySzx

new full working solver https://github.com/D3-vin/Turnstile-Solver-NEW

D3-vin avatar Sep 04 '25 19:09 D3-vin

The problem is that the turnstile is now served inside a closed shadow root which is not supported by playwright.

Are you sure about that? The code doesn't use closed shadow roots to interact with the challenge widget, but it simply clicks on the widget button. I haven't looked into it any longer because in my specific usecase it works now. If you have a specific site you're looking to generate turnstile tokens and it still doesn't work type the url, so that I can test it if I have some spare time.

error [22:22:06] [ERROR] -> Browser 1: Error solving Turnstile: Page.eval_on_selector: Failed to find element matching selector "//div[@Class='cf-turnstile']"

If you provide the website you’re trying to access specifically I’ll give it a look when I have some free time

i try website https://bitupdate.info/login

devslengkak avatar Sep 06 '25 15:09 devslengkak

新的完全工作求解器 https://github.com/D3-vin/Turnstile-Solver-NEW

It's Working!

u-wlkjyy avatar Nov 11 '25 00:11 u-wlkjyy