On Ubuntu 20.04 LTS server
Trying to run selenium on ANY browser in python.
Started just by running in headless mode in terminal but it complains
(environment) ubuntu@mail:~/xx/environment/bin$ firefox --headless
*** You are running in headless mode.
[GFX1-]: glxtest: libEGL initialize failed
[GFX1-]: glxtest: libEGL initialize failed
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
[GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
But hey i thought I'd try in python with no luck.
I've realised I probably should have Xvfb running so I've set like this
Xvfb :1 & export DISPLAY=:1
Same error as above.
Then we come to python, I'm trying to use selenium and its throwing this error
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 127
So then I've tried the xvfbwrapper (and pyvirtualdisplay) both with no luck.
with Xvfb() as xvfb:
# launch stuff inside virtual display here.
# It starts/stops in this code block.
# display = Display(visible=0, size=(800, 600))
# display.start()
options = Options()
# options.headless = True #### SAME ERROR IF THIS IS ON OR NOT
options.add_argument("--width=1200")
options.add_argument("--height=630")
options.binary_location = r'/usr/bin/firefox'
driver = webdriver.Firefox(options=options, executable_path="/usr/bin/geckodriver")
url = urllib.parse.unquote_plus(encoded_url)
driver.get(url if "http" in url else "https://" + url)
still same error 127
(I've tried similar with chrome and its got an error also)
I think there must be something wrong with my config on the server but I'm at a point where I want to throw it out the window, please google is so light on details for this error. If any one can shed some light would be appreciated.