To run chrome-headless just add --headless via chrome_options.add_argument, i.e.:

from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
#chrome_options.add_argument("--disable-extensions")
#chrome_options.add_argument("--disable-gpu")
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(chrome_options=chrome_options)

start_url = "https://google.com"
driver.get(start_url)
print(driver.page_source.encode("utf-8"))
driver.quit()

# b'<!DOCTYPE html><html xmlns="http://www....

So my thought is that running it with headless chrome would make my script faster.

Try using chrome options like --disable-extensions or --disable-gpu and benchmark it, but I wouldn't count with much improvement.


References: https://developers.google.com/web/updates/2017/04/headless-chrome

Running Selenium with Headless Chrome Webdriver - Stack Overflow

https://stackoverflow.com/questions/53657215/running-selenium-with-headless-chrome-webdriver

To run chrome-headless just add --headless via chrome_options.add_argument , i.e.: from selenium import webdriver from ...

Getting Started with Headless Chrome | Web | Google Developers

https://developers.google.com/web/updates/2017/04/headless-chrome

Headless Chrome is shipping in Chrome 59. It's a way to run the Chrome browser in a headless environment. Essentially, running Chrome without chrome!

How to run a headless Chrome browser in Selenium WebDriver. | by ...

https://itnext.io/how-to-run-a-headless-chrome-browser-in-selenium-webdriver-c5521bc12bf0

Nov 15, 2020 ... Starting with version 60, the Chrome browser introduced the ability to run in headless mode. We now have the ability to launch the browser ...

Downloads - ChromeDriver - WebDriver for Chrome

https://chromedriver.chromium.org/downloads

... seem to pass unload event properly; Resolved issue 3649: Copying selected text to clipboard does not work on Windows 10 when using headless mode.

Running Selenium with Headless Chrome

https://intoli.com/blog/running-selenium-with-headless-chrome/

Apr 14, 2017 ... A guide to setting up Selenium to work with the new headless functionality of Google Chrome.

Driving Headless Chrome with Python | Decipher

https://duo.com/decipher/driving-headless-chrome-with-python

May 23, 2017 ... Back in April, Google announced that it will be shipping Headless Chrome in Chrome 59. Since the respective flags are already available on ...

Headless Chromium

https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Headless Chromium allows running Chromium in a headless/server environment . ... chrome --headless --remote-debugging-port=9222 https://chromium.org.

Running Chrome Headless with Selenium & Python on Linux ...

https://blog.testproject.io/2018/02/20/chrome-headless-selenium-python-linux-servers/

Feb 20, 2018 ... How to run UI Automation Tests on remote Linux servers with Chrome headless Tutorial. Using CentOS as Linux server but achieved on most ...

Making Chrome Headless Undetectable

https://intoli.com/blog/making-chrome-headless-undetectable/

Aug 9, 2017 ... Using MitmProxy and injected JavaScript feature mocks to bypass Headless Chrome detection tests.

Headless Chrome: DevOps Love It, So Do Hackers, Here's Why ...

https://www.imperva.com/blog/headless-chrome-devops-love-it-so-do-hackers-heres-why/

Nov 28, 2018 ... Headless mode is a functionality that allows the execution of a full version of the latest Chrome browser while controlling it programmatically. It ...