Selenium install

Selenium is a web automation tool. A web browser can be controlled using Python code, any task you would normally do on the web can be done using the selenium module.

Related course
Browser Automation with Python Selenium

To install the selenium module, type the command:

pip install -U selenium

Then get the web driver from https://docs.seleniumhq.org/projects/webdriver. There are all kind of webdrivers including:

  • ChromeDriver

  • FirefoxDriver

  • RemoteWebDriver

After installation of the web driver, we can make Python start the browser using:

from selenium import webdriver
import time

options = webdriver.ChromeOptions()
options.binary_location = "/usr/bin/chromium"
driver = webdriver.Chrome(chrome_options=options)

This will start the Chromium browser and open the python site.

selenium chromium Selenium will start the chromium browser automatically

Leave a Reply

Login disabled