下载ChromeDriver的工具。
get-chromedriver的Python项目详细描述
获取ChromeDriver
下载ChromeDriver的工具。您可以选择下载最新的beta版本(如果当前有), 最新的稳定版本或特定版本。 您可以将此工具用作包导入或命令行应用程序。在
安装
要安装:
$ pip install get-chromedriver
要升级:
^{pr2}$使用
包导入
fromget_chromedriverimportGetChromeDriver# Platforms to choose from: 'win', 'linux' or 'mac'get_driver=GetChromeDriver(platform='win')# Print the latest stable release versionprint(get_driver.latest_stable_release_version())# Print the latest stable release download linkprint(get_driver.latest_stable_release_url())# Print the download link of a specific releaseprint(get_driver.release_url('84.0.4147.30'))# Download the latest stable driver release# Optional: use output_path='' to specify where to download the driver# Optional: use extract=True to extract the zip fileget_driver.download_latest_stable_release(output_path='webdriver',extract=True)# Download the latest stable driver release# Optional: use output_path='' to specify where to download the driver# Optional: use extract=True to extract the zip fileget_driver.download_release('84.0.4147.30',extract=True)
命令行
打印所有平台的稳定发布url:
$ get-chromedriver --latest-urls
打印稳定版本:
$ get-chromedriver --stable-version
打印特定平台的稳定发布url:
$ get-chromedriver --stable-url linux
下载特定平台的稳定版本:
$ get-chromedriver --download-stable win
下载特定平台的特定版本并提取zip文件:
$ get-chromedriver --download-release mac 84.0.4147.30 --extract
下载的驱动程序默认下载位置:
<current directory>/<get-chromedriver_downloads>/<release version>/<platform>/<chromedriver.zip>
注意:与Beta版本相关的选项和函数只有在当前可用的情况下才有效。
选项
--help Show help.
--beta-version Print the beta release version.
--stable-version Print the stable release version.
--latest-urls Print the beta and stable release urls for all platforms.
--release-url Print the url of a release for a platform.
--beta-url Print the beta release url for a platform.
--stable-url Print the stable release url for a platform.
--download-beta Download the beta release for a platform.
--downlaod-stable Download the stable release for a platform.
--downlaod-release Download a release.
--extract Option to extract the zip file.
--version Program version.
- 项目
标签: