Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在ubuntu终端上运行headless Chrome?_Python_Selenium_Google Chrome_Ubuntu - Fatal编程技术网

Python 如何在ubuntu终端上运行headless Chrome?

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

我对ubuntu和selenium的网页抓取还不熟悉。最近,我在Ubuntu服务器上运行python web抓取脚本时遇到了问题。我通过终端远程访问了ubuntu服务器

当我尝试在Ubuntu服务器上运行代码时,出现以下错误:

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沙箱

我想问题是浏览器没有显示?我怎样才能解决这个问题

多谢各位