Skip to main content

Driver downloader for Selenium

Project description

Driloader

pypi version license python versions contributors Build Status

Selenium drivers downloader tool with standalone CLI support.

Why is it for?

Selenium needs a specific driver to work with each browser. Every driver has a version that works with specific browser versions, and it's really annoying reading the changelogs to check if the current driver will work with the new browser version. Plus, a lot of times a test crashes because the browser has updated and the driver is not compatible anymore. That's why Driloader exists: To make this process so much easier! Driloader autodetect the browser version (it supports Chrome, Firefox and Internet Explorer) and download the driver according to it's version.

Requires

  • Python 3.4 or higher

Setup the project

This project uses Pipenv as packaging tool. Please make sure you have it installed in your system.

Also, we use make as task runner, so you can see the available tasks by running make help.

# Clone the project
bash: $ git clone https://github.com/lucasmello/Driloader.git
bash: $ cd Driloader
# Install dependencies
bash: $ make install
pipenv install --dev
Installing dependencies from Pipfile.lock…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 20/20  00:00:03
# Active virtual env
bash: $ pipenv shell
source ~/.local/share/virtualenvs/driloader-ZPASDPNJ/bin/activate
# Run linter and tests
(driloader-ZPASDPNJ) driloader: $ make lint test

Installing

 pip install driloader

Usage with Firefox

from driloader import driloader
from selenium.webdriver import Firefox

driver_path = driloader.download_gecko_driver()
browser = Firefox(executable_path=driver_path)
browser.get("http://www.google.com")
browser.quit()

Usage with Chrome

from driloader import driloader
from selenium.webdriver import Chrome

driver_path = driloader.download_chrome_driver()
browser = Chrome(executable_path=driver_path)
browser.get("http://www.google.com")
browser.quit()

Usage with Internet Explorer

from driloader import driloader
from selenium.webdriver import Ie

driver_path = driloader.download_ie_driver()
browser = Ie(executable_path=driver_path)
browser.get("http://www.google.com")
browser.quit()

CLI and standalone usage

python -m driloader

usage: driloader [-h] (--firefox | --chrome | --internet-explorer | --all)

optional arguments:
  -h, --help            show this help message and exit
  --firefox, -f         get Firefox version.
  --chrome, -c          get Google Chrome version.
  --internet-explorer, -i
                        get Internet Explorer version.
  --all                 look for browsers an get their versions.

Retrieve Firefox version

$  python -m driloader --firefox
45

Retrieve Google Chrome version

$  python -m driloader --chrome
58

Retrieve Internet Explorer version (Windows system)

> python -m driloader -i
11

Retrieve all browsers version (Windows system)

> python -m driloader --all
Internet Explorer: 11
Firefox: 45
Google Chrome: 58

Retrieve all browsers version (non-Windows system)

# Getting from a non-Windows system
$  python -m driloader --all
Internet Explorer: Error: Unable to get the Internet Explorer version.
        Cause: Error: Unable to retrieve IE version..
        Cause: System is not Windows.
Firefox: 45
Google Chrome: 58

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

driloader-1.2.5.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

driloader-1.2.5-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file driloader-1.2.5.tar.gz.

File metadata

  • Download URL: driloader-1.2.5.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for driloader-1.2.5.tar.gz
Algorithm Hash digest
SHA256 8a736129b7da686cc43376ffa2ff4ebb92d2153510ba17005e25efe0fb9f6ed6
MD5 e0fbeb7d7fef35d4066db96d2abe0148
BLAKE2b-256 4d4fecc6eee0126f02da5ad1aa1b08757fef8a0ad1a31cfb85f7feaa7a6bf6dc

See more details on using hashes here.

File details

Details for the file driloader-1.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for driloader-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3f40ee562333a4831ab52c080106572b993d0880ce6fcc3ae714cd2cbd83bc5c
MD5 08173d67df77ea25d59d384b1871c620
BLAKE2b-256 1afca391765f2936871ef95f01cd0b1736f86261448f3dd94f80acfa8222ee0d

See more details on using hashes here.

Supported by

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