セレンを使用してUbuntuのサーバー

Ubuntサーバ18.04 LTS 64ビットサーバのバージョン(なしコマンドラインインターフェイスバージョン)の下に設置されているすべての以下の行わ


まず、Chromeをインストール

まず、次のコマンドを実行してみてください
sudo apt update
sudo apt install -y libappindicator1 fonts-liberation
cd temp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb

エラーがある場合は、基本的な理由があるため、必要な依存関係の不足のあるされて、次のコマンドを実行します。

sudo apt -f install
sudo dpkg --configure -a
sudo apt -u dist-upgrade
sudo apt -y install dbus-x11 xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic xfonts-scalable

// 上面这些命令执行完了后,再次安装,一般能成功了

sudo apt update
sudo apt install -y libappindicator1 fonts-liberation
cd temp
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
リファレンス

https://blog.softhints.com/ubuntu-16-04-server-install-headless-google-chrome/
プルダウンするために、サイトを開いた後、ソリューションは、Ubuntuの16.04で何のGoogle Chromeをインストールしていないドラッグ GUIをこのセクション

インストール結果を確認します

正常にインストールされているバージョン番号を調べることによって決定することができます。

google-chrome --version
或者
google-chrome-stable --version

あなたは、そのバージョン番号が正常にインストールされてプリントアウトすることができます。

テスト

あなたがしたい場合は、コマンドラインをテストするには、このパラメータ--no-sandboを追加する必要があります同様に、コードは、--no-sandboを追加する必要があります

google-chrome-stable --headless --no-sandbox --disable-gpu --dump-dom https://www.chromestatus.com/



第二に、Firefoxのインストール

おすすめ

転載: www.cnblogs.com/quanquan616/p/11922771.html
おすすめ