Giter Site home page Giter Site logo

chromedriver_installer's Introduction

ChromeDriver Installer for Python

https://travis-ci.org/peterhudec/chromedriver_installer.svg?branch=master

Installs ChromeDriver executable with pip or setup.py.

Usage

Manual Installation

Clone the repository:

(e)$ git clone https://github.com/peterhudec/chromedriver_installer.git

Install the most recent ChromeDriver version without verifying checksum.

(e)$ python setup.py install

Install specific ChromeDriver version without verifying checksum.

(e)$ python setup.py install --chromedriver-version=2.10

Install specific ChromeDriver version and verify checksum. Note that you can pass multiple coma-separated checksums to the --chromedriver-checksums option. This is useful if you plan to install ChromeDriver on various platforms because there is separate version with different checksum for each platform. You can get the checksums for specific version/platform combinations at the chromedriver download URL.

(e)$ python setup.py install \
    --chromedriver-version=2.10 \
    --chromedriver-checksums=4fecc99b066cb1a346035bf022607104,058cd8b7b4b9688507701b5e648fd821

After install, there should be the chromedriver executable available in your path:

(e)$ which chromedriver
/home/andypipkin/e/bin/chromedriver
(e)$ chromedriver --version
ChromeDriver 2.10.267518
(e)$ chromedriver
Starting ChromeDriver (v2.10.267518) on port 9515
Only local connections are allowed.

Installation With PIP

The same as before except you need to pass the install options wrapped in pip's --install-option="" option.

(e)$ pip install chromedriver_installer \
    --install-option="--chromedriver-version=2.10" \
    --install-option="--chromedriver-checksums=4fecc99b066cb1a346035bf022607104,058cd8b7b4b9688507701b5e648fd821"

Installation With easy_install

I can't seem to find a way to make easy_install pass user options to setup.py so you only can install the most recent ChromeDriver version with easy_install.

How it Works

The build_scripts command of the setup.py script invoked by python setup.py install downloads, the ChromeDriver zip archive version specified in the --chromedriver-version option from http://chromedriver.storage.googleapis.com/index.html to the temp directory of the operating system. If the --chromedriver-checksums option is set, the archive is validated against the supplied checksums (you can get the checksums at the aforementioned URL). If the validation failed, the installation exits with an error. If the validation was successful or if the --chromedriver-checksums option is not set, the archive will be unzipped to the build directory and installed as an executable to the bin directory.

If the --chromedriver-version option is ommited, it installs the most recent chromedriver version without checksum validation.

Testing

You need tox to run the tests.

(e)$ git clone https://github.com/peterhudec/chromedriver_installer.git
(e)$ pip install -r requirements.txt
(e)$ tox

chromedriver_installer's People

Contributors

peterhudec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

chromedriver_installer's Issues

[SSL: CERTIFICATE_VERIFY_FAILED] error upon pip install

I'm trying to pip install chromedriver_installer, but I'm getting the following error:

(venv) Kurts-MacBook-Pro-2:lucy-web kurtpeek$ pip install chromedriver_installer
Collecting chromedriver_installer
  Downloading https://files.pythonhosted.org/packages/c8/01/0a8a725bb605f68923aba16099a01cbbfe547c8b7dc96fd9a554424f6524/chromedriver_installer-0.0.6.tar.gz
Building wheels for collected packages: chromedriver-installer
  Running setup.py bdist_wheel for chromedriver-installer ... error
  Complete output from command /Users/kurtpeek/Documents/Dev/lucy/lucy-web/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-build-ff302o9e/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/tmpd0wnbewlpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/chromedriver_installer
  copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
  running build_scripts
  error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
  
  ----------------------------------------
  Failed building wheel for chromedriver-installer
  Running setup.py clean for chromedriver-installer
Failed to build chromedriver-installer
Installing collected packages: chromedriver-installer
  Running setup.py install for chromedriver-installer ... error
    Complete output from command /Users/kurtpeek/Documents/Dev/lucy/lucy-web/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-build-ff302o9e/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-dr4oqd3y-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/kurtpeek/Documents/Dev/lucy/lucy-web/venv/bin/../include/site/python3.6/chromedriver-installer:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/chromedriver_installer
    copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
    running build_scripts
    error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
    
    ----------------------------------------
Command "/Users/kurtpeek/Documents/Dev/lucy/lucy-web/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-build-ff302o9e/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-dr4oqd3y-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/kurtpeek/Documents/Dev/lucy/lucy-web/venv/bin/../include/site/python3.6/chromedriver-installer" failed with error code 1 in /private/var/folders/dc/nv4yxcrd0zqd2dtxlj281b740000gn/T/pip-build-ff302o9e/chromedriver-installer/
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Any idea how to fix this?

Not installing the latest version of chromedriver.

Hey @peterhudec - I've been using this chromedriver_installer within my own python package for a while now and it's been great. However, I am running into an issue right now. I am trying to get a newer version of chromedriver installed because the current version that your tool is installing is kind of broken. The latest version that your tool is installing is v2.16 but I need at least v2.19. Is it possible to update the logic to download the latest version of chromedriver?

latest google release at https://sites.google.com/a/chromium.org/chromedriver/downloads breaks chromedriver_installer

$ pip install chromedriver_installer
Collecting chromedriver_installer
  Using cached https://files.pythonhosted.org/packages/c8/01/0a8a725bb605f68923aba16099a01cbbfe547c8b7dc96fd9a554424f6524/chromedriver_installer-0.0.6.tar.gz
Building wheels for collected packages: chromedriver-installer
  Running setup.py bdist_wheel for chromedriver-installer ... error
  Complete output from command /home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-mb8ywpxd --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/chromedriver_installer
  copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
  running build_scripts
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 220, in <module>
      cmdclass=dict(build_scripts=BuildScripts, install=Install)
    File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/ubuntu/.venv/pr/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 188, in run
      self.run_command('build')
    File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 119, in run
      chromedriver_version = get_chromedriver_version()
    File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 47, in get_chromedriver_version
      .format(CHROMEDRIVER_INFO_URL))
  Exception: Unable to get latest chromedriver version from https://sites.google.com/a/chromium.org/chromedriver/downloads
  
  ----------------------------------------
  Failed building wheel for chromedriver-installer
  Running setup.py clean for chromedriver-installer
Failed to build chromedriver-installer
Installing collected packages: chromedriver-installer
  Running setup.py install for chromedriver-installer ... error
    Complete output from command /home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-urk9zw8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.venv/pr/include/site/python3.6/chromedriver-installer:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/chromedriver_installer
    copying chromedriver_installer/__init__.py -> build/lib/chromedriver_installer
    running build_scripts
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 220, in <module>
        cmdclass=dict(build_scripts=BuildScripts, install=Install)
      File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 190, in run
        install.run(self)
      File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 119, in run
        chromedriver_version = get_chromedriver_version()
      File "/tmp/pip-install-0napzveo/chromedriver-installer/setup.py", line 47, in get_chromedriver_version
        .format(CHROMEDRIVER_INFO_URL))
    Exception: Unable to get latest chromedriver version from https://sites.google.com/a/chromium.org/chromedriver/downloads
    
    ----------------------------------------
Command "/home/ubuntu/.venv/pr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-0napzveo/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-urk9zw8c/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/.venv/pr/include/site/python3.6/chromedriver-installer" failed with error code 1 in /tmp/pip-install-0napzveo/chromedriver-installer/

New Chromedriver version Regexp verification error

After ChromeDriver copy the version pattern from Chrome,
run install with new chromedriver version will get regexp error:

pip install chromedriver_installer --upgrade --force-reinstall --install-option="--chromedriver-version=73.0.3683.68"

Log:
`python3.7/site-packages/pip/_internal/commands/install.py:207: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting chromedriver_installer
Using cached https://files.pythonhosted.org/packages/c8/01/0a8a725bb605f68923aba16099a01cbbfe547c8b7dc96fd9a554424f6524/chromedriver_installer-0.0.6.tar.gz
Skipping bdist_wheel for chromedriver-installer, due to binaries being disabled for it.
Installing collected packages: chromedriver-installer
Found existing installation: chromedriver-installer 0.0.6
Uninstalling chromedriver-installer-0.0.6:
Successfully uninstalled chromedriver-installer-0.0.6
Running setup.py install for chromedriver-installer ... error
Complete output from command /Users/peresh/.local/share/virtualenvs/Static-iTester-_9S97GHa/bin/python3.7 -u -c "import setuptools, tokenize;file='/private/var/folders/29/d_qvpc592hg470n29c3v5y5h0000gn/T/pip-install-afnb8phj/chromedriver-installer/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/29/d_qvpc592hg470n29c3v5y5h0000gn/T/pip-record-zvzfefqb/install-record.txt --single-version-externally-managed --compile --install-headers /Users/peresh/.local/share/virtualenvs/Static-iTester-_9S97GHa/bin/../include/site/python3.7/chromedriver-installer --chromedriver-version=73.0.3683.68:
running install
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/29/d_qvpc592hg470n29c3v5y5h0000gn/T/pip-install-afnb8phj/chromedriver-installer/setup.py", line 220, in
cmdclass=dict(build_scripts=BuildScripts, install=Install)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/29/d_qvpc592hg470n29c3v5y5h0000gn/T/pip-install-afnb8phj/chromedriver-installer/setup.py", line 182, in run
CHROMEDRIVER_VERSION_PATTERN.pattern))
Exception: Invalid --chromedriver-version=73.0.3683.68! Must match /^\d+.\d+$/

pip install

Isn't it possible to pip install git+https://github.com/peterhudec/chromedriver_installer.git?
If so, why are the extra steps for git clone etc. in the readme?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.