Selenium Headless

To run the Selenium Firefox webdriver without starting the GUI you need to set the headless option in the FirefoxOptions.

from selenium import webdriver

options = webdriver.FirefoxOptions()
options.headless = True
browser = webdriver.Firefox(firefox_options=options)

Note: There's a method called set_headless for this class which seems to work, but the documentation says that it is deprecated so it's probably better to do it this way.