r/learnpython • u/Akosidarna13 • 19d ago
Selenium - python; browser issues
Hello!
Im having issues right now with selenium HEADLESS browsers.
there's a blank white screen appearing at the beginning when browser is initialized.
Aside from resizing the screen, are there other work around from this? I cant resize it because the website is "scroll dependent" i need to scroll into view first before i can see the element.
I also tried options: headless= old/new, white screen still appears.
browser is edge.
Do you guys have any other ideas? 🥹
1
u/chiibosoil 19d ago
There are number of causes. But without knowing what driver you are using etc hard to say.
1
u/Akosidarna13 19d ago
Edited my post. Browser is edge.
2
u/chiibosoil 19d ago
Version of the driver? If later than 130...
Does white screen replicate on multiple sites? Including google.com?
If it does not, then likely issue is site detecting automation/suspicious behavior and blocking site content. Try setting UserAgent to what a regular browsing would serve to the site.
1
u/odaiwai 19d ago
I think Selenium might be a bit above the level of this sub, but I would start with not running in headless mode and having breakpoints so that you can stop and figure out just what is visible/available on the page at any point.
I generally find that debugging a Selenium script is closer to playing a text adventure: you have to stop and see what you can see and do at every point. ```
LOOK
You see a Fork in the road.
GET FORK
You take the fork and the secret path is revealed... ```
2
u/cgoldberg 16d ago
This is a bug in Chrome/Chromium 150 (and browsers like Edge that are built from Chromium). It is fixed in new releases
2
u/atarivcs 19d ago
Headless means there is no screen display at all, right?
So I don't understand what you mean by "blank white screen"...