Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rpa_driver_downloader-0.2.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rpa_driver_downloader-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

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

Hashes for rpa_driver_downloader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 332a7b76fec0f1c61e4e7beef31def901452f7ab29c29106e64092363020d28d
MD5 6e6ff49e0e5a3c74d2c92117255b937c
BLAKE2b-256 18342a3a393fa8fdc65a52ce9268c7033bbc0b5f99ce432a2ba6d66fe1edeb44

See more details on using hashes here.

File details

Details for the file rpa_driver_downloader-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rpa_driver_downloader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dff7799944fec5bffe18a27feb040ec8d3ea4a98938d92fb4f21342f5dbdfc0b
MD5 f93c33e6ca19b1a063a4afc095de5b68
BLAKE2b-256 5cd3260b99c4d81e9a57d7d98564d765533ba66e7278588f243acb0b99693704

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page