from selenium import webdriver options = webdriver.FirefoxOptions() options.add_argument("--headless") webdriver.Firefox(options=options).quit()