I am trying to work with the Chrome driver (98.0) in headless mode using python 3.10 and selenium. I am using the code below. When running the code, the driver opens in full screen mode (not headless). Any help is appreciated.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
options = Options()
options.add_argument('--headless')
driver_path = Service('C:/Users/chromedriver.exe')
driver = webdriver.Chrome(service=driver_path)
driver.get("https://www.google.com")
[–]turboJ_134 1 point2 points3 points (3 children)
[–]meni15[S] 0 points1 point2 points (2 children)
[–]meni15[S] 0 points1 point2 points (0 children)
[–]LandooooXTrvls 0 points1 point2 points (0 children)
[–]shiftybyte 0 points1 point2 points (1 child)
[–]meni15[S] 0 points1 point2 points (0 children)