Chromedriver安装程序
chromedriver_installer的Python项目详细描述
安装ChromeDriver executable 使用pip或setup.py。
用法
手动安装
克隆存储库:
(e)$ git clone https://github.com/peterhudec/chromedriver_installer.git
在不验证校验和的情况下安装最新的chromedriver版本。
(e)$ python setup.py install
在不验证校验和的情况下安装特定的chromedriver版本。
(e)$ python setup.py install --chromedriver-version=2.10
安装特定的chromedriver版本并验证校验和。 注意,您可以将多个以昏迷分隔的校验和传递给 --chromedriver-checksums选项。如果您计划安装 chromedriver在不同的平台上,因为有单独的版本 每个平台有不同的校验和。你可以得到特定的校验和 版本/平台组合 chromedriver download URL。
(e)$ python setup.py install \ --chromedriver-version=2.10 \ --chromedriver-checksums=4fecc99b066cb1a346035bf022607104,058cd8b7b4b9688507701b5e648fd821
安装后,应该有chromedriver可执行文件 在您的路径中可用:
(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.
安装PIP
与以前一样,只是需要传递包装在pip中的安装选项 --install-option=""选项。
(e)$ pip install chromedriver_installer \ --install-option="--chromedriver-version=2.10"\ --install-option="--chromedriver-checksums=4fecc99b066cb1a346035bf022607104,058cd8b7b4b9688507701b5e648fd821"
易于安装的安装
我似乎找不到使易于安装的方法将用户选项传递给 setup.py因此您只能安装最新的 chromedriver带有easy_安装的版本。
工作原理
由调用的setup.py脚本的build\u脚本命令 python setup.py install下载,chromedriverzip存档版本 在--chromedriver-version选项中指定 http://chromedriver.storage.googleapis.com/index.html 到操作系统的temp目录。 如果设置了--chromedriver-checksums选项,则验证存档 根据提供的校验和 (您可以在前面提到的url获取校验和)。 如果验证失败,则安装将退出一个错误。 如果验证成功,或者如果--chromedriver-checksums选项 未设置,存档将解压缩到build目录并安装 作为bin目录的可执行文件。
如果--chromedriver-version选项被commited,它将安装最新的 chromedriver版本,无校验和验证。
测试
您需要tox来运行测试。
(e)$ git clone https://github.com/peterhudec/chromedriver_installer.git (e)$ pip install -r requirements.txt (e)$ tox