import os from selenium import webdriver from selenium.webdriver.chrome.service import Service def create_chrome_driver(): options = webdriver.ChromeOptions() options.add_argument("--disable-background-timer-throttling") options.add_argument("--disable-backgrounding-occluded-windows") options.add_argument("--disable-renderer-backgrounding") options.add_argument("--disable-features=CalculateNativeWinOcclusion") options.add_argument("--disable-hang-monitor") options.add_argument("--disable-popup-blocking") options.add_argument("--disable-background-networking") options.add_argument("--disable-component-update") options.add_argument("--disable-sync") options.add_argument("--disable-default-apps") options.add_experimental_option("excludeSwitches", ["enable-logging"]) service = Service(log_output=os.devnull) return webdriver.Chrome(service=service, options=options)