Linux 尝试启动selenium chromedriver unix centos7时出现错误chrome as崩溃
我在这个错误上花了几个小时。已尝试所有给定的解决方案,但仍存在以下错误:Linux 尝试启动selenium chromedriver unix centos7时出现错误chrome as崩溃,linux,selenium,google-chrome,centos,selenium-chromedriver,Linux,Selenium,Google Chrome,Centos,Selenium Chromedriver,我在这个错误上花了几个小时。已尝试所有给定的解决方案,但仍存在以下错误: 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 locatio
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.)
我有一个linux/centos7——我正在使用ssh putty连接服务器。
我有
谷歌浏览器-版本
铬驱动-v
ChromeDriver 85.0.4183.87
这是我的密码
#!/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()
我也试过了
#!/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()
并且仍然有相同的错误。通过ssh,我尝试了根用户和非根用户,但仍然是一样的
作为信息,在做
google chrome--无沙盒:提供:
[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
我补充说,我已经成功安装了google chrome,但在安装过程中出现了一条错误消息:“重定向到/bin/systemctl start atd.service
无法启动atd。服务:未找到装置。“(我在plesk下)
已经阅读了上一篇文章,您是否碰巧在服务器上安装了X11
无法打开X显示
?谢谢我解决了这篇文章:WebDriverException:未知错误:已阅读上一篇文章您是否碰巧在服务器上安装了X11<代码>无法打开X显示?谢谢,我已解决此问题,感谢此帖子:WebDriverException:未知错误:
[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
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é !