seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
4.45k stars 908 forks source link

Lots of UC Mode examples still need to be updated #2880

Closed mdmintz closed 4 days ago

mdmintz commented 4 days ago

Lots of UC Mode examples still need to be updated

It's been a busy month of changes to existing CAPTCHA systems (eg. Cloudflare). Lots of UC Mode example tests in the SeleniumBase/examples folder are still using uc_click() for clicking a Turnstile checkbox, when really uc_gui_handle_cf() is needed now (with the pyautogui enhancements) when clicking the checkbox is required (generally only on Linux, because UC Mode for the most part bypasses the need to click those checkboxes on macOS and Windows).

Sometime in the past year, the test-only Cloudflare CAPTCHA returned a "Success" regardless of whether a bot was detected. Looks like this (with the "Testing only." written on it):

Screenshot 2024-06-27 at 5 57 31 PM

In the updated description:

Screenshot 2024-06-27 at 5 31 51 PM

And I used that here:

Screenshot 2024-06-27 at 10 41 18 PM

So although those test CAPTCHAs won't ever return a failure anymore, I can still have the tests (that go to that page) demonstrate how to click it properly when the click is needed. That involves using sb.uc_gui_handle_cf() now. A bunch of example tests need updates for that. Note that I already have some tests that go to real websites with real Cloudflare CAPTCHAs. And I also created a bunch of websites that use the Brotector CAPTCHA that I designed, which detects bots well:

Screenshot 2024-06-27 at 10 56 23 PM

Tests for those have already been added in 4.28.0.

Time to patch up the remaining example tests...

mdmintz commented 4 days ago

This was resolved in 4.28.1 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.28.1