I have spent hours on this error. tried all the given solutions and still have the following error :
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
I have a linux/centos7 - I am using ssh putty to connect the serveur. I have google-chrome --version
Google Chrome 85.0.4183.102
chromedriver -v
ChromeDriver 85.0.4183.87
Here is my code
#!/usr/bin/python3.6
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
url='https://www.google.com'
option = webdriver.ChromeOptions()
option.add_argument('–-no-sandbox')
option.add_argument('–-headless')
option.add_argument("--disable-extensions")
driver = webdriver.Chrome(chrome_options=option)
driver.get(url)
print(driver.page_source)
driver.quit()
I have also tried with
#!/usr/bin/python3.6
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from pyvirtualdisplay import Display
display = Display(visible=0, size=(1024, 768))
display.start()
driver = webdriver.Chrome()
url='https://www.google.com'
driver.get(url)
print(driver.page_source)
driver.quit()
and still have the same error. Through ssh I have tried as root and non-root user but still the same..
As information, when doing
google-chrome --no-sandbox : gives :
[4463:4463:0919/160950.452059:ERROR:browser_main_loop.cc(1417)] Unable to open X display.
[root@ns344379 mail_from_any_webpage]# [0919/160950.501241:ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[0919/160950.501399:ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
and I add that I had installed google-chrome successfully but I had an error message while installation : "Redirecting to /bin/systemctl start atd.service Failed to start atd.service: Unit not found." (I am under plesk)
Running transaction
Installation : google-chrome-stable-85.0.4183.102-1.x86_64 1/1
Redirecting to /bin/systemctl start atd.service
Failed to start atd.service: Unit not found.
Vérification : google-chrome-stable-85.0.4183.102-1.x86_64 1/1
Installé :
google-chrome-stable.x86_64 0:85.0.4183.102-1
Terminé !