Skip to content

Instantly share code, notes, and snippets.

@pr1boom
pr1boom / multiprocess_selenium.py
Created March 15, 2020 00:14 — forked from wooddar/multiprocess_selenium.py
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