How can I use Selenium?

Chrome WebDriver

From August 2021, the use of the Free plan's Chrome process becomes a reason for blocking the service policy and may cause the sanctioning of the use of the service.

Follow the instructions below to install Selenium, Chrome, ChromeDriver.

Install Selenium

pip3 install selenium

Install Chrome

wget -q -O - | apt-key add -
echo 'deb [arch=amd64] stable main' | tee /etc/apt/sources.list.d/google-chrome.list
apt-get update
apt-get install -y google-chrome-stable

Install ChromeDriver

It is necessary to install the ChromeDriver of a version that is compatible with the Chrome version installed in the previous step. Please follow the instructions below to check the Chrome version and install the correct version of the ChromeDriver.

Check the Chrome version

google-chrome --version

Check the ChromeDriver version to be installed

Download the ChromeDriver

You can download the ChromeDriver via the following terminal command. Replace the text [ChromeDriver Version] with the version number you checked in the previous step.
wget -N[ChromeDriver Version]/
What is expected to seem like when the download is completed

Install the ChromeDriver

Enter the following command to complete the installation of the downloaded ChromeDriver.
chmod +x chromedriver
mv -f chromedriver /usr/local/share/chromedriver
ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
apt-get update
apt-get install -y libgconf-2-4

Python code example

from selenium import webdriver
from import Options
options = Options()
driver = webdriver.Chrome(options=options)
When using the headless option as above, it is normal that a new window of the Chrome browser does not appear. Since the goormIDE container is an environment without a display, you must use the headless option when using Selenium.