Python 如何在ubuntu终端上运行headless Chrome?
我对ubuntu和selenium的网页抓取还不熟悉。最近,我在Ubuntu服务器上运行python web抓取脚本时遇到了问题。我通过终端远程访问了ubuntu服务器 当我尝试在Ubuntu服务器上运行代码时,出现以下错误:Python 如何在ubuntu终端上运行headless Chrome?,python,selenium,google-chrome,ubuntu,Python,Selenium,Google Chrome,Ubuntu,我对ubuntu和selenium的网页抓取还不熟悉。最近,我在Ubuntu服务器上运行python web抓取脚本时遇到了问题。我通过终端远程访问了ubuntu服务器 当我尝试在Ubuntu服务器上运行代码时,出现以下错误: selenium.common.exceptions.WebDriverException:消息:未知错误:Chrome无法启动:异常退出 (未知错误:DevToolsActivePort文件不存在) (从chrome location/usr/bin/google ch
selenium.common.exceptions.WebDriverException:消息:未知错误:Chrome无法启动:异常退出
(未知错误:DevToolsActivePort文件不存在)
(从chrome location/usr/bin/google chrome启动的进程不再运行,因此ChromeDriver假设chrome已经崩溃。)
(驱动程序信息:chromedriver=2.41.578700
(2F1ED5F9343C13F73144538F15C000B370EDA6706),平台=Linux 4.15.0-74-generic x86_64)
我已经在服务器上安装了chrome、chrome驱动程序和selenium。当我检查Chrome在服务器上的位置时,它返回:
google-chrome:/usr/bin/google-chrome
当我试图通过/usr/bin/google chrome
运行google chrome时,它返回以下错误:
~$[0715/183414.382630:错误:nacl\u helper\u linux.cc(308)]nacl helper进程在没有沙箱的情况下运行代码>
您很可能需要正确配置SUID沙箱
我想问题是浏览器没有显示?我怎样才能解决这个问题
多谢各位