A Python package to automatically download and manage WebDrivers for Gecko, Chrome, and Edge.
Project description
๐งฉ rpa-driver-downloader 0.2.0
rpa-driver-downloader is a lightweight Python package that automatically downloads and manages the latest WebDriver binaries (Gecko, Chromium, Edge) for browser automation using Selenium, BotCity, or any other RPA tool.
Whether you're automating browsers on Linux, Windows, or macOS, this library ensures that the required driver is downloaded and ready to use โ with just one line of code.
๐ Features
- โ Automatically downloads GeckoDriver, ChromeDriver, and EdgeDriver
- ๐พ Stores drivers locally in a /drivers/ folder
- ๐ Saves driver paths in settings.json for future reuse
- ๐ง Detects your OS and architecture automatically
- ๐ If a newer version of the driver is detected, the old one is automatically replaced
- ๐ Returns absolute path to be used with Selenium or BotCity
- โ๏ธ Supports optional version selection โ pass a specific version if needed!
- ๐ If not provided, the latest stable version is used by default
- ๐ If an invalid version is passed, a clear error is raised with a link to available versions
- ๐งช Great for testing and RPA automation workflows
โ ๏ธ Important
Your browser must be installed on the system.
This package only downloads the WebDriver (the browser controller). It does not install Firefox, Chrome, or Edge themselves.
๐น This is a common requirement when using Selenium.
๐น BotCity may work without explicitly referencing the installed browser, depending on configuration.
๐ฆ Installation
pip install rpa-driver-downloader
โ๏ธ Usage
from rpa_driver_downloader import Gecko, Chromium, Edge
# 1) Using instance method (old way, still works)
gecko_path = Gecko(version="0.34.0").path_for_the_driver()
chrome_path = Chromium(version="122.0.6261.95").path_for_the_driver()
edge_path = Edge(version="124.0.2478.0").path_for_the_driver()
# 2) Using class method (recommended for simplicity)
gecko_path = Gecko.get_driver_path(version="0.34.0")
chrome_path = Chromium.get_driver_path(version="122.0.6261.95")
edge_path = Edge.get_driver_path(version="124.0.2478.0")
# 3) Assigning to variables for reuse
gecko = Gecko(version="0.34.0")
gecko_path = gecko.path_for_the_driver()
This will:
- Check if the driver exists locally
- If not found or outdated, it will download and replace it
- Return the full absolute path to the binary
If a version is specified:
- It will try to download the requested version, otherwise it will try to download the latest available version
- If the version is invalid or not found, it will raise an error with a link to the available versions
Example: Using with Selenium
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service
from rpa_driver_downloader import Gecko
# Create Firefox options
firefox_options = Options()
# โ
Use a specific GeckoDriver version
service = Service(executable_path=Gecko.get_driver_path(version="0.34.0"))
driver = webdriver.Firefox(service=service, options=firefox_options)
driver.get("https://github.com/ruanSTT/rpa-driver-downloader")
driver.quit()
# โ
Use the latest GeckoDriver version
service = Service(executable_path=Gecko.get_driver_path())
driver = webdriver.Firefox(service=service, options=firefox_options)
driver.get("https://github.com/ruanSTT/rpa-driver-downloader")
driver.quit()
Example: Using with BotCity
from botcity.web import WebBot
from rpa_driver_downloader import Gecko
# Instantiate the WebBot
bot = WebBot()
# โ
Using a specific version
bot.driver_path(driver_path=Gecko.get_driver_path(version="0.34.0"))
bot.browse("https://github.com/ruanSTT/rpa-driver-downloader")
# โ
Using the latest available version (default behavior)
bot.driver_path(driver_path=Gecko.get_driver_path()) # <- Donโt pass any parameter!
bot.browse("https://github.com/ruanSTT/rpa-driver-downloader")
๐ Supported Browsers & Platforms
| Browser | Windows | Linux | macOS |
|---|---|---|---|
| Firefox | โ | โ | โ |
| Chrome | โ | โ | โ |
| Edge | โ | โ | โ |
๐ Project Structure
rpa-driver-downloader/
โโโ rpa_driver_downloader/
โ โโโ __init__.py
โ โโโ base.py
โ โโโ gecko.py
โ โโโ chromium.py
โ โโโ edge.py
โโโ settings.json # Created automatically
โโโ drivers/ # Driver binaries stored here
โโโ setup.py
โโโ README.md
โ ๏ธ Python Compatibility
This library is compatible with:
โ Python 3.7 up to 3.12.3 (inclusive)
Versions higher than 3.12.3 are currently not supported due to instability and possible incompatibilities.
Internally, the library depends on requests>=2.31.0, which does not rely on the deprecated cgi module.
If you are using Python 3.12.3 or lower, you should not encounter compatibility issues.
Please note that support for Python versions greater than 3.12.3 will be considered once those versions stabilize.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
rpa-driver-downloader is a Python package that automatically downloads and manages the latest Gecko, Chrome, and Edge WebDriver binaries. Designed for use with Selenium and RPA tools like BotCity, it detects the OS and ensures the correct driver is always available โ no manual download required.
๐ค Contributing
Contributions, issues and feature requests are welcome! Feel free to check the issues page or submit a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rpa_driver_downloader-0.2.0.tar.gz.
File metadata
- Download URL: rpa_driver_downloader-0.2.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
332a7b76fec0f1c61e4e7beef31def901452f7ab29c29106e64092363020d28d
|
|
| MD5 |
6e6ff49e0e5a3c74d2c92117255b937c
|
|
| BLAKE2b-256 |
18342a3a393fa8fdc65a52ce9268c7033bbc0b5f99ce432a2ba6d66fe1edeb44
|
File details
Details for the file rpa_driver_downloader-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rpa_driver_downloader-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dff7799944fec5bffe18a27feb040ec8d3ea4a98938d92fb4f21342f5dbdfc0b
|
|
| MD5 |
f93c33e6ca19b1a063a4afc095de5b68
|
|
| BLAKE2b-256 |
5cd3260b99c4d81e9a57d7d98564d765533ba66e7278588f243acb0b99693704
|