Run this code here:
$ nano selenium_demo_headless.py
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
service = Service('/usr/bin/chromedriver')
chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_argument("headless")
driver = webdriver.Chrome(service=service, options=chromeOptions)
driver.get('https://forums.raspberrypi.com')
print(driver.title)
driver.quit()
Inspired by: https://forums.raspberrypi.com/viewtopic.php?t=359017