Install Google Chrome

Install Google Chrome. I tried it on Ubuntu 18.

Add a repository for Google Chrome.

sudo sh -c'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'

Add the required libraries in advance.

sudo apt install -y wget
sudo apt install -y gnupg

Add the public key.

sudo wget -q -O --https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add-

Updated repository for Google Chrome.

sudo apt update

Install Google Chrome with the apt command.

sudo apt install -y google-chrome-stable

Let's check the version.

google-chrome --version

This is the output result of the version.

Google Chrome 96.0.4664.45

Run Google Chrome headless

Headless execution means accessing a website without a GUI screen. Run Google Chrome headless and take a screenshot.

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

It is OK if the HTML tree is displayed on the screen.

How to do JavaScript-compatible web scraping in Perl?

To do JavaScript-enabled web scraping in Perl, in addition to Google Chrome, Install Chrome Driver and Perl module Selenium::Remote::Driver is required.

If you want to delete the repository for Google Chrome.

If you want to delete the repository for Google Chrome

This is the procedure when you want to delete the repository for Google Chrome due to mistakes.

sudo rm /etc/apt/sources.list.d/google-chrome.list

Associated Information