Skip to content

Instantly share code, notes, and snippets.

View wooddar's full-sized avatar

Hugo Darwood wooddar

View GitHub Profile
@wooddar
wooddar / multiprocess_selenium.py
Last active May 8, 2024 03:59
Easy Python script to run selenium web workers/browsers in parallel
"""
This is an adaptable example script for using selenium across multiple webbrowsers simultaneously. This makes use of
two queues - one to store idle webworkers and another to store data to pass to any idle webworkers in a selenium function
"""
from multiprocessing import Queue, cpu_count
from threading import Thread
from selenium import webdriver
from time import sleep
from numpy.random import randint