seleniumbase / SeleniumBase

📊 Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
5.3k stars 973 forks source link

There's a blank window bug on Windows with headless Chromium 129 #3156

Closed mdmintz closed 1 month ago

mdmintz commented 1 month ago

There's a blank window bug on Windows with headless Chromium 129

There's already a ticket here: https://issues.chromium.org/issues/367755364. (It doesn't sound like they're going to fix it, so I will.)

The simple fix is to move the window off-screen when using headless Chromium on Windows:

--window-position=-2400,-2400

chrome_options.add_argument("--window-position=-2400,-2400")

That's what I've been telling people to do on Stack Overflow: Stack Overflow: Chrome 129 Headless shows blank window Stack Overflow: Selenium headless broke after Chrome update

I'll apply my fix directly into SeleniumBase so that it's automatic when using headless Chromium on Windows.

CatalinaCharlotte commented 1 month ago

I have a question: If I am using 'Driver()', how should I add 'option'?

mdmintz commented 1 month ago

This was resolved in 4.31.0 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.31.0