Closed iamumairayub closed 4 weeks ago
See the example that uses ThreadPoolExecutor
with UC Mode: https://github.com/seleniumbase/SeleniumBase/issues/2478#issuecomment-1981699298
import sys
from concurrent.futures import ThreadPoolExecutor
from seleniumbase import Driver
sys.argv.append("-n") # Tell SeleniumBase to do thread-locking as needed
def launch_driver(url):
driver = Driver(uc=True)
try:
driver.get(url=url)
driver.sleep(2)
finally:
driver.quit()
urls = ['https://seleniumbase.io/demo_page' for i in range(3)]
with ThreadPoolExecutor(max_workers=len(urls)) as executor:
for url in urls:
executor.submit(launch_driver, url)
I have code in my Windows
In logs I can see
The URL is opened fine in one of thread/process
I can clearly see browser window
But on the 2nd window its always like this
Logs also show
I have tried both ProcessPoolExecutor/ThreadPoolExecutor I have tried both SB/Driver