Python seleniumbase driver start headless in my raspberry pi but I don't want to

705 views Asked by At

I'm using seleniumbase on a windows environment to run my tests without enabling headless but when I put the code on my raspberry pi and want to run the same tests the driver switches to headless so I can't see what's going on but I don't want to...

I only use option uc=True but the driver.get doesn't appear to me but work whereas in Windows I can see the driver

driver = Driver(uc=True)
driver.get('https://www.google.com/')
2

There are 2 answers

1
Michael Mintz On

For a SeleniumBase headed browser on Linux (where headless is the default setting), use this for the Driver Manager format with UC Mode:

from seleniumbase import Driver

driver = Driver(uc=True, headed=True)
# ...
driver.quit()

For anyone here new to SeleniumBase UC Mode, (which makes improvements to undetected-chromedriver), there's a new video summarizing it here: https://www.youtube.com/watch?v=5dMFI3e85ig)

1
Daviid On

I was thinking something like:

from selenium.webdriver.chrome.options import Options

options = Options()
options.headless = True
driver = webdriver.Chrome(CHROMEDRIVER_PATH, options=options)

I'm not sure where your Driver comes from as you haven't posted the full code. Does it support headless=False as an argument?

Also, how do you execute the python script in rpi?