Skip to content

Issues with open many browsers with uc_gui_handle_cf and ThreadPoolExecutor #3324

Answered by mdmintz
SenseiSol asked this question in Q&A
Discussion options

You must be logged in to vote

For multithreading, you have two options:

  1. pytest via pytest-xdist. (Eg. pytest -n3, as seen in SeleniumBase/examples/presenter/multi_uc.py)
  2. ThreadPoolExecutor as shown in SeleniumBase/help_docs/uc_mode.md.

Note that now there's CDP Mode, which is an upgrade over regular UC Mode. Add sb.uc_gui_click_captcha() as needed.

The number of threads should not exceed the number of CPUs on a system.

Also note that the CAPTCHA-clicking methods use PyAutoGUI: Only one thread is allowed to move the mouse at one time.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SenseiSol
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants