Overview

Selenium 4.1, released on January 14, 2022, improves Selenium Manager for automatic driver management and adds new configuration options.

Main Features

Improved Selenium Manager

Selenium Manager automatically detects and downloads the driver compatible with the installed browser, simplifying initial setup.

python
from selenium import webdriver

# No need to manually download the driver
driver = webdriver.Chrome()  # Selenium Manager handles it
driver.get('https://example.com')
print(driver.title)
driver.quit()

New configuration options

Browser options are simplified with a unified API for Chrome, Firefox, and Edge, making headless mode and preference configuration easier.

python
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--headless')
options.add_argument('--window-size=1920,1080')

driver = webdriver.Chrome(options=options)
driver.get('https://example.com')
print(driver.page_source[:100])
driver.quit()

Sources