Is there a way to hide the browser while running selenium in Python?


I am working on a project with selenium to scrape the data, but I don’t want the browser to open and pop up. I just wanted to hide the browser and also not to display it in the taskbar also…

Some also suggested to use phantomJS but I didn’t get them. What to do now …


If you’re using Chrome you can just set the headless argument like so:

from selenium import webdriver
from import Options

driver_exe = 'chromedriver'
options = Options()
driver = webdriver.Chrome(driver_exe, options=options)

Answered By – Meshi

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published