Though I knew people asked this question but I didn't find suitable answer so I asked again. I used PhantomJS to scrape web site, but it is very slow on Mac, so I want to tru Chrome but Chrome show browser that is is bad, can I hide it? I tried code as below, that still show a small browser window..
browser = webdriver.Chrome()
browser.set_window_position(0, 0)
browser.set_window_size(0, 0)
Google announced in 4/2017 you can run in headless.
https://developers.google.com/web/updates/2017/04/headless-chrome
chrome_options = Options()
# Chrome v75 and lower:
# chrome_options.add_argument("--headless")
# Chrome v 76 and above (v76 released July 30th 2019):
chrome_options.headless = True
chrome_options.binary_location = '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary'
driver = webdriver.Chrome(executable_path=os.path.abspath(“chromedriver"), chrome_options=chrome_options)
Few things you should make sure