Chrome Options in Python Selenium : Disable GPU vs Headless

Mahesh Kumaran picture Mahesh Kumaran · Nov 26, 2019 · Viewed 14.4k times · Source

In python-selenium chrome_options, What exactly is the difference between the following two options, I know both runs the selenium script without opening the browser.

chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')

Answer

Guy picture Guy · Nov 26, 2019

--disable-gpu doesn't run the script without opening the browser, only --headless. It used to be needed on Windows Issue 737678: Headless: make --disable-gpu flag unnecessary, but this bug was fixed. chrome_options.add_argument('--headless') is all you need.