-
Hi, i'm testing SelenuimBase 4.40.6 on keepa.com, where there is Cloudflare Turnstile. I need a solution with driver and not sb. Also, the solution must works on Windows, MacOS, Linux, and Linux without GUI, without showing the browser. I created a loop to check the bypass code repetitively. My script open the page https://tinyurl.com/pm5xvzw8, it is a shorter link because the link is too long. After that, sometimes the site shows Turnstile, sometimes not, so i add cdp.gui_click_element. I use driver.cdp.gui_click_element("#turnstile div") because the Turnstile is in a popup in shodow-root (check attached images). The site loads content only if i put the mouse on an element, so i use ActionChains for ".fa.fa-search" element. At this point, sometimes the site shows Turnstile again, sometimes not, so i add cdp.gui_click_element again. After that, i extract the ASINs from the elements. Watch the attached video to see the code running. My code is:
The HTML code of the Turnstile is:
Problems:
Thanks :) VIDEO |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since you can't see into closed Shadow-root elements, methods like If the CAPTCHA is only partially loaded, add more wait time before calling one of the clicking methods. As mentioned above, there's no way to see if the CAPTCHA has finished loading since it's inside closed Shadow-root. You can set the |
Beta Was this translation helpful? Give feedback.
Since you can't see into closed Shadow-root elements, methods like
sb.cdp.gui_click_element(selector)
andsb.uc_gui_click_captcha()
do their best to click on the CAPTCHA through the Shadow-root, but they can't see inside to know if the CAPTCHA has already been solved or is even there anymore. To force the likelihood of the CAPTCHA not getting solved automatically, you can change your user agent to something fake, eg:agent="cool"
. That'll likely force the CAPTCHA to not get solved automatically.If the CAPTCHA is only partially loaded, add more wait time before calling one of the clicking methods. As mentioned above, there's no way to see if the CAPTCHA has finished loading since it's ins…