Overview
Selenium 4.18, released on March 2, 2024, improves Python 3.12 support and wait mechanisms.
Main Features
Python 3.12 support
Full Python 3.12 compatibility is ensured, fixing deprecation issues.
python
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://example.com')
print(driver.title)
driver.quit()
Improved waits
Explicit waits are more reliable with better condition handling and polling.
python
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 10)
element = wait.until(
EC.presence_of_element_located((By.ID, 'result'))
)
