[Python] Selenium headless broke after Chrome update [duplicate]

Discussão em 'Python' iniciado por Stack, Setembro 26, 2024.

  1. Stack

    Stack Membro Participativo

    After updating google chrome this weekend, headless mode using Selenium python API is bringing up a blank window when running in windows. The identical code I had running on a Debian VM does not work any longer.

    Here is a code snippet:

    chrome_options = Options()
    chrome_options.add_argument("--headless=new") #previously used --headless
    chrome_options.add_argument('--disable-gpu')
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument("--disable-dev-shm-usage")
    chrome_options.add_argument("--disable-automation")
    chrome_options.add_argument("--disable-extensions")
    chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
    driver = webdriver.Chrome(options=chrome_options)


    To isolate the problem, I removed all fqdn dns blocks I had enforced for privacy including: ad.doubleclick.net, analytics.yahoo.com, google-analytics.com, googleadservices.com, plausible.io, stats.g.doubleclick.net

    Continue reading...

Compartilhe esta Página