As stated by the accepted answer:
options.add_argument("--headless"headless=new") # for Chrome >= 109 These tips might help to speed things up especially for headless:
There are quite a few things you can do in headless that you cant do in non headless
Since you will be using Chrome Headless, I've found adding this reduces the CPU usage by about 20% for me (I found this to be a CPU and memory hog when looking at htop)
--disable-crash-reporter
This will only disable when you are running in headless This might speed things up for you!!!
My settings are currently as follows and I reduce the CPU (but only a marginal time saving) by about 20%:
options.add_argument("--no-sandbox"); options.add_argument("--disable-dev-shm-usage"); options.add_argument("--disable-renderer-backgrounding"); options.add_argument("--disable-background-timer-throttling"); options.add_argument("--disable-backgrounding-occluded-windows"); options.add_argument("--disable-client-side-phishing-detection"); options.add_argument("--disable-crash-reporter"); options.add_argument("--disable-oopr-debug-crash-dump"); options.add_argument("--no-crash-upload"); options.add_argument("--disable-gpu"); options.add_argument("--disable-extensions"); options.add_argument("--disable-low-res-tiling"); options.add_argument("--log-level=3"); options.add_argument("--silent"); I found this to be a pretty good list (full list I think) of command line switches with explanations: https://peter.sh/experiments/chromium-command-line-switches/
Some additional things you can turn off are also mentioned here: https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
I hope this helps someone