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-sandboxgoogle-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/
下载成功,但有报错