centos7 中怎么安装chromedp v1.0,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
由于采集需要用到chromedp,由于过程比较曲折,特意将过程记录下来,以便遇到类似的朋友做个参考:1.安装chrome
curl https://intoli.com/install-google-chrome.sh | bash


安装完成后最终显示如下
Complete! Successfully installed Google Chrome!
检查是否还缺乏依赖:
ldd /opt/google/chrome/chrome | grep "not found"
执行
google-chrome-stable --headless --disable-gpu --screenshot https://www.baidu.com/
运行chrome 报错:

必须以--no-sandbox
模式运行。所以标准测试命令如下:
google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/
还是报错:

yum install \
ipa-gothic-fonts \
xorg-x11-fonts-100dpi \
xorg-x11-fonts-75dpi \
xorg-x11-utils \
xorg-x11-fonts-cyrillic \
xorg-x11-fonts-Type1 \
xorg-x11-fonts-misc -y

成功了,再次运行命令:
google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot https://www.baidu.com/

下载成功,但有报错

关于centos7 中怎么安装chromedp v1.0问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注天达云行业资讯频道了解更多相关知识。