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

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/')

  • Have you tried explicitly setting options.headless = False?

    – 




  • I try: driver = Driver(uc=True,headless=False) but it’s the same problem

    – 

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?

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)

Leave a Comment