自动化网站截图环境安装

花生 可爱的博主

时间: 2021-12-24 阅读: 59 字数:950

{}
自动化chrome截图工具

安装对

wget http://npm.taobao.org/mirrors/chromedriver/96.0.4664.18/chromedriver_linux64.zip

unzip chromedriver_linux64.zip 

截图测试

google-chrome-stable --headless --disable-gpu --screenshot https://www.suning.com/

[如果用户是管理员root]必须以--no-sandbox模式运行。所以标准测试命令如下:

google-chrome-stable --no-sandbox --headless --disable-gpu --screenshot https://www.suning.com/

安装浏览器

yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

然而,仍然有错误:

[0100/000000.311368:ERROR:broker_posix.cc(43)] Invalid node channel message

翻墙求助了好久,发现解决方案,仍然缺乏依赖:

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
本文章网址:https://www.sjxi.cn/detil/d3372a803f3043639f2c05a383a1d02a

最新评论

当前未登陆哦
登陆后才可评论哦

湘ICP备2021009447号