Running Selenium headless with multiple spiders Running Selenium headless with multiple spiders selenium selenium

Running Selenium headless with multiple spiders


I suggest using the splinter browser handler instead; it is a wrapper around selenium. It solves your problem exactly, as the Display handling is done by the package.

With a few more package installations, you can also remove the need for a Display altogether, meaning splinter is now headless (the browser window does not open, and it is much faster). Check out the Splinter docs to know how to make in headless. I personally suggest the PhantomJS driver, even though you'll have to install the non-Python PhantomJS program.