options = webdriver.FirefoxOptions() options.add_argument('-headless') browser = webdriver.Firefox(options=options)