webdriver-manager

4.0.2 · active · verified Thu Apr 09

webdriver-manager is a Python library that automatically manages browser drivers for Selenium. It handles downloading, installing, and caching the correct driver executable for your installed browser, eliminating manual driver management. The current version is 4.0.2, and it maintains an active release cadence with frequent bug fixes and support for new browser versions.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `webdriver-manager` to automatically obtain the correct Chrome driver, then integrate it with `selenium` to launch a browser, navigate to a URL, and print its title. Replace `ChromeDriverManager` with `GeckoDriverManager` for Firefox, `EdgeChromiumDriverManager` for Edge, etc.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

# Automatically download and install the correct ChromeDriver
driver_path = ChromeDriverManager().install()

# Initialize the Chrome service with the installed driver
service = Service(driver_path)

# Initialize the Chrome WebDriver
driver = webdriver.Chrome(service=service)

# Example usage: navigate to a page
driver.get("https://www.google.com")
print(f"Page title: {driver.title}")

# Close the browser
driver.quit()

view raw JSON →