🖥

#docker + #Centos で headless #GoogleChrome を使って URL指定でキャプチャ画像を作成する

2019/10/29に公開
docker run -it centos
yum -y install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm

yum -y install https://rpmfind.net/linux/centos/7.7.1908/os/x86_64/Packages/ipa-gothic-fonts-003.03-5.el7.noarch.rpm

google-chrome --headless --disable-gpu --no-sandbox -window-size=1024,768 --hide-scrollbars --screenshot='yahoo.png' https://www.yahoo.co.jp
docker ps 

docker cp <CONTAINER_ID>:/yahoo.png ./ && open yahoo.png

image

参考

Amazon Linux 2 で Headless Chrome を動かしてみた - Qiita

Original by Github issue

https://github.com/YumaInaura/YumaInaura/issues/2636

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

https://line.me/ti/g2/eEPltQ6Tzh3pYAZV8JXKZqc7PJ6L0rpm573dcQ

Twitter

https://twitter.com/YumaInaura

公開日時

2019-10-29

Discussion