Closed stuckinthe closed 4 weeks ago
I didn't see any issues when I ran your script:
from seleniumbase import Driver
driver = Driver(uc=True)
driver.uc_open_with_reconnect('https://example.com/')
html = driver.page_source
driver.quit()
However, note that you should use google-chrome-stable
or google-chrome
, not chromium
on Linux if you want to remain undetected. Also, you probably want to use the SB()
format instead with xvfb=True
:
with SB(uc=True, xvfb=True) as sb:
# ...
That will handle running a headed browser on a headless display.
Thanks for the help. The Arm Arch doesn't have a google-chrome package. I have tried it again with the added true statement. The website must be doing something as it just started happening.
from seleniumbase import Driver driver = Driver(uc=True, xvfb=True) driver.uc_open_with_reconnect('https://example.com/') html = driver.page_source driver.quit()
Driver()
does not have the xvfb
arg. You need to use SB()
for that.
Unfortunately, I get a cannot connect to chrome error with SB()
But this works without issue
from seleniumbase import Driver driver = Driver(uc=True) driver.get('https://google.com/')
I've been using SeleniumBase for awhile without issue and then all of a sudden today. The website must be detecting SB and closing the window as I get a window already closed when trying to grab the page source. Running Arch Linux Aarch64 on a RPi 5. Using chromium as this is the only chrome package I have
ChromeDriver 122.0.6261.129 Chromium 122.0.6261.128 Arch Linux ARM
I haven't changed anything on my system since yesterday.
Anyone can point me in the right direction on how to solve this.