Closed SaberTawfiq closed 1 week ago
If you look at the HTML elements of the website you provided using your browser's DevTools, you will not find an element with the ID turnstile-wrapper
.
The logic you copied from another repo is intended to work for Cloudflare Challenge Pages, not Turnstile Captcha on a website so you will have to modify your clickCycle
method.
it was working and click on the verify you are human in the CF 'Under Attack' and the Cloudflare Captcha, with this
if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5):
time.sleep(1.5)
self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()
Now the iframe not fond because they add the cloudflare code in shadow dom
how to handle this?
it was working and click on the verify you are human in the CF 'Under Attack' and the Cloudflare Captcha, with this
if self.driver.wait.ele_displayed('xpath://div/iframe',timeout=1.5): time.sleep(1.5) self.driver('xpath://div/iframe').ele("Verify you are human", timeout=2.5).click()
Now the iframe not fond because they add the cloudflare code in shadow dom
Yes, with the iframe encapsulated within the closed shadow root, it makes it impossible to use XPath to get the iframe from the document root.
Hence, the use of driver.wait.ele_displayed('#turnstile-wrapper',timeout=1.5)
in the original CloudflareBypassForScraping repo which obtains the parent element of the encapsulated iframe that is just outside the closed shadow root.
However, for Turnstile Captcha on a website, there could be multiple Turnstile Captchas. Hence, the removal of the #turnstile-wrapper
unique element.
Following that similar logic, you could obtain the app-cloudflare-captcha-container
tag or select the element with the class cf-turnstile-wrapper
and call .click
afterwards.
Does the CloudflareBypassForScraping method still work for you? Yes, it can locate #turnstile-wrapper, but it can't click on anything.
Does the CloudflareBypassForScraping method still work for you? Yes, it can locate #turnstile-wrapper, but it can't click on anything.
That's Right
@Tspm1eca @KJHJason @SaberTawfiq @yongchin0821 @g1879 anyone can improve my code I have bot for this site I can pay thanks if you are interested please ping me on telegram: @iamdev2 with screen short of this page
@Tspm1eca @KJHJason @SaberTawfiq @yongchin0821 @g1879 anyone can improve my code I have bot for this site I can pay thanks if you are interested please ping me on telegram: @iamdev2 with screen short of this page
I don't have telegram. Find me at g1879@qq.com. Or at WeChat: green1879
@Tspm1eca @KJHJason @SaberTawfiq @yongchin0821 @g1879 anyone can improve my code I have bot for this site I can pay thanks if you are interested please ping me on telegram: @iamdev2 with screen short of this page
I don't have telegram. Find me at g1879@qq.com. Or at WeChat: green1879
Added on wechat, do you support contentDocument, cloudflare added it
any solution ?
i can't baypass the cloudflare on this website https://visa.vfsglobal.com/egy/en/hrv/login
here is my codes need help