LoginSignup
4
0

More than 5 years have passed since last update.

Firefox を headlessで起動

Last updated at Posted at 2018-11-07

Xvfbが不要になってありがたい。

起動

起動
firefox --headless \
  "https://yahoo.co.jp"

画面キャプチャ

起動
firefox --headless \
 --screenshot "a.png" \
  "https://yahoo.co.jp"

firefoxが既に起動しています の対応

  • profile を新規で指定すればよい。
起動
mkdir ./profile/

firefox --headless \
 --profile ./profile/ \
 --screenshot "a.png" \
  "https://yahoo.co.jp"

*** You are running in headless mode. 表示を消す

この表示を消したい場合は以下

起動
firefox --headless \
 --profile ./profile/ \
 --screenshot "a.png" \
  "https://yahoo.co.jp" 2>/dev/null
4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0