Overview
Selenium 4.5, released on October 26, 2022, improves Selenium Manager with automatic browser and driver downloads.
Main Features
Automatic download
Selenium Manager automatically downloads the driver compatible with the installed browser, eliminating manual setup.
python
from selenium import webdriver
# Selenium Manager auto-downloads the driver
driver = webdriver.Chrome()
driver.get('https://example.com')
print(f'Title: {driver.title}')
driver.quit()
Improved locators
Relative locators are improved for finding elements relative to other page elements.
python
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.relative_locator import locate_with
driver = webdriver.Chrome()
driver.get('https://example.com')
# Relative locator
# element = driver.find_element(
# locate_with(By.TAG_NAME, 'input').near(
# driver.find_element(By.ID, 'label')
# )
# )
driver.quit()
