Skip to content

Conversation

mdmintz
Copy link
Member

@mdmintz mdmintz commented Sep 25, 2025

CDP Mode: Patch 57

One of the key improvements is being able to click through multiple CAPTCHAs at nearly the same time.
See the following example: SeleniumBase/examples/cdp_mode/raw_multi_captcha.py, which spins up multiple windows via ThreadPoolExecutor, and then solves mutliple CAPTCHAs.

from concurrent.futures import ThreadPoolExecutor
from random import randint
from seleniumbase import decorators
from seleniumbase import sb_cdp

def main(url):
    sb = sb_cdp.Chrome(url, lang="en")
    sb.set_window_rect(randint(4, 680), randint(8, 380), 840, 520)
    sb.sleep(2.2)
    sb.gui_click_captcha()
    sb.sleep(2)
    sb.driver.quit()

if __name__ == "__main__":
    urls = ["https://seleniumbase.io/apps/turnstile" for i in range(5)]
    with decorators.print_runtime("raw_multi_captcha.py"):
        with ThreadPoolExecutor(max_workers=len(urls)) as executor:
            for url in urls:
                executor.submit(main, url)

@mdmintz mdmintz self-assigned this Sep 25, 2025
@mdmintz mdmintz added enhancement Making things better dependencies This involves updating a dependency file tests This involves test updates or new tests SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Sep 25, 2025
@mdmintz mdmintz merged commit a014dc9 into master Sep 25, 2025
6 checks passed
@mdmintz mdmintz deleted the cdp-mode-patch-57 branch September 25, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies This involves updating a dependency file enhancement Making things better SeleniumBase 4 SeleniumBase 4 tests This involves test updates or new tests UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant