1

I am running the following code:

from selenium import webdriver

driver = webdriver.Firefox()  
driver.get("https://web.whatsapp.com/")

I have installed firefox under /usr/bin/firefox and geckodriver (same version) under /usr/bin/geckodriver

However, I am getting the following stacktrace error when the Python code is run:

selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1

Full code is here: https://github.com/harshitsidhwa/WhatsApp-bot-selenium/blob/master/whatsapp.py

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
nvster
  • 11
  • 1
  • 3
  • How are you getting _`['"917570090256"', '"Hello world"', '"sidhwa JIIT"', '"temp"']`_ – undetected Selenium Mar 26 '22 at 17:53
  • it's a part of the script I am running, however the stack trace error occurs as the reason of some problem with selenium driver – nvster Mar 26 '22 at 18:29
  • try this for selenium webdrive: https://stackoverflow.com/questions/71603374/my-ide-gives-me-a-chrome-driver-error-when-trying-to-run-webbot/71626868#71626868 – D.L Mar 26 '22 at 19:13

2 Answers2

0

This error message...

selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1

...implies that the GeckoDriver was unable to initiate/spawn a new Browsing Context i.e. session.

Possibly there are some incompatibility between the version of the binaries you are using.


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u311.
  • Selenium is upgraded to current levels Version 4.1.3.
  • GeckoDriver is upgraded to GeckoDriver v0.30.0 level.
  • Firefox is upgraded to current Firefox v98.0.2 levels.
  • GeckoDriver is present in the desired location.
  • GeckoDriver is having executable permission for non-root users.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
0

I have the same error message when I running Selenium 4 + Firefox on Centos 8

I check the log file geckodriver.log

It is showing

Running Firefox as root in a regular user's session is not supported.

so I'm using a non-root user to run the same Python script, It is working now.

jasondayee
  • 549
  • 4
  • 11