Google chrome 谷歌chrome——无头——屏幕截图上出现了这样一条信息;无法获取下载目录";在Centos 7

Google chrome 谷歌chrome——无头——屏幕截图上出现了这样一条信息;无法获取下载目录";在Centos 7,google-chrome,headless,google-chrome-headless,Google Chrome,Headless,Google Chrome Headless,我试图通过命令行在Centos 7框中使用Google Chrome 59(Google Chrome 59.0.3071.86)的新功能获取屏幕截图,但我收到一个错误消息,说它无法获取下载目录。我试图在我的主文件夹中创建目录,但没有成功!有什么建议吗 [root@vm_1 ~]# google-chrome-stable --headless --disable-gpu --enable-logging -v=5 --screenshot=out.png http://www.goog

我试图通过命令行在Centos 7框中使用Google Chrome 59(Google Chrome 59.0.3071.86)的新功能获取屏幕截图,但我收到一个错误消息,说它无法获取下载目录。我试图在我的主文件夹中创建目录,但没有成功!有什么建议吗

    [root@vm_1 ~]# google-chrome-stable --headless --disable-gpu --enable-logging -v=5 --screenshot=out.png http://www.google.com
    [0613/154943.103775:VERBOSE1:zygote_main_linux.cc(626)] ZygoteMain: initializing 0 fork delegates
    [0613/154943.104006:INFO:cpu_info.cc(50)] Available number of cores: 1
    [0613/154943.108816:VERBOSE1:audio_manager_pulse.cc(273)] Failed to connect to the context.  Error: Connection refused
    [0613/154943.108868:WARNING:audio_manager.cc(293)] Multiple instances of AudioManager detected
    [0613/154943.108875:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected
    [0613/154943.109345:VERBOSE1:webrtc_internals.cc(106)] Could not get the download directory.
    Trace/breakpoint trap
    [root@vm_1 ~]# google-chrome-stable --version
    [root@vm_1 ~]# Google Chrome 59.0.3071.86
以下是我的文件夹结构:

    [root@vm_1 ~]# ls -la
    total 56
    dr-xr-x---. 12 root root  4096 Jun 13 15:23 .
    dr-xr-xr-x. 17 root root  4096 Jun 13 13:42 ..
    -rw-------.  1 root root  1116 Dec 24  2015 anaconda-ks.cfg
    drwx------.  3 root root    16 Jan 22 10:10 .ansible
    -rw-------.  1 root root 18800 Jun 13 14:59 .bash_history
    -rw-r--r--.  1 root root    18 Dec 28  2013 .bash_logout
    -rw-r--r--.  1 root root   176 Dec 28  2013 .bash_profile
    -rw-r--r--.  1 root root   176 Dec 28  2013 .bashrc
    drwx------.  3 root root    16 Oct 24  2016 .cache
    drwx------.  3 root root    26 Jun 13  2017 .config
    -rw-r--r--.  1 root root   100 Dec 28  2013 .cshrc
    drwxr-xr-x.  2 root root     6 Jun 13  2017 download
    drwxr-xr-x.  2 root root     6 Jun 13  2017 Download
    drwxr-xr-x.  2 root root     6 Jun 13  2017 downloads
    drwxr-xr-x.  2 root root     6 Jun 13  2017 Downloads
    drwxr-xr-x.  3 root root    18 Jun 13  2017 .local
    drwxr-----.  3 root root    18 Dec 24  2015 .pki
    drwx------.  2 root root    28 Jan 22 10:09 .ssh
    -rw-r--r--.  1 root root   129 Dec 28  2013 .tcshrc
    -rw-r--r--   1 root root   228 Jun 13 15:23 test.py
    [root@vm_1 ~]#

我在这里找到了答案:

修复方法是安装google字体包:

$ sudo yum install gnu-free-sans-fonts
那么这应该是可行的:

$ google-chrome --headless --disable-gpu --enable-logging -v=10  --screenshot=out.png http://www.chromestatus.com