Skip to main content

A tool to download and install GeckoDriver.

Project description

Get GeckoDriver

PyPI - Python Version PyPI PyPI - Status PyPI - License

A tool to download and install GeckoDriver. Download the latest release or another specific release. You can use this tool as a package import or as a command-line application.

Install

To install:

$ pip install get-gecko-driver

To upgrade:

$ pip install get-gecko-driver --upgrade

Usage

Install and use GeckoDriver with Selenium

import time
from get_gecko_driver import GetGeckoDriver
from selenium import webdriver

# Install the driver:
# Downloads the latest GeckoDriver release
# Adds the downloaded GeckoDriver to path
get_driver = GetGeckoDriver()
get_driver.install()

# Use the installed GeckoDriver with Selenium
driver = webdriver.Firefox()
driver.get("https://google.com")
time.sleep(3)
driver.quit()

For downloading only

from get_gecko_driver import GetGeckoDriver

get_driver = GetGeckoDriver()

# Print the latest release version
print(get_driver.latest_release_version())

# Print the latest release download link
print(get_driver.latest_release_url())

# Print the download link of a specific release
print(get_driver.release_url('0.27.0'))

# Download the latest driver release
# Optional: use output_path= to specify where to download the driver
# Optional: use extract=True to extract the file
get_driver.download_latest_release(extract=True)

# Download a specific driver release
# Optional: use output_path= to specify where to download the driver
# Optional: use extract=True to extract the file
get_driver.download_release('0.27.0', extract=True)

Command-line

Print the latest release url of all platforms:

$ get-gecko-driver --latest-urls

Print the latest release version:

$ get-gecko-driver --latest-version

Print the latest release url:

$ get-gecko-driver --latest-url

Download the latest release and extract the file:

$ get-gecko-driver --download-latest --extract

Download a specific release and extract the file:

$ get-gecko-driver --download-release 0.27.0 --extract

The downloaded driver can be found at:

<current directory>/<geckodriver>/<version>/<bin>/<geckodriver>

Options

--help                      Show help.

--latest-version            Print the latest release version.

--latest-urls               Print the latest release urls for all platforms.

--release-url               Print the url of a release.

--latest-url                Print the latest release url.

--download-latest           Download the latest release.

--download-release          Download a specific release.

--extract                   Extract the compressed driver file.

--version                   Program version.

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

get-gecko-driver-0.1.9.tar.gz (9.8 kB view hashes)

Uploaded Source

Supported by

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