针对115以上版本的谷歌游览器自动升级selenium驱动。
Project description
升级到最新版:
pip install UpdateChromeDriver --index-url https://pypi.org/simple/ -U
目前本库仅在Windows上测试通过,Mac不敢确认,欢迎使用Mac的童鞋测试。
核心用法示例:
import time
from UpdateChromeDriver import *
options = webdriver.ChromeOptions()
options.add_experimental_option(
'excludeSwitches', ['enable-logging', 'enable-automation'])
browser = getChromeBrowser(options)
browser.get("https://www.baidu.com/")
time.sleep(2)
所有版本的驱动会下载到 ~\.cache\selenium
,可以按需清理。
下载来源:https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
其他功能
获取当前操作系统的平台:
from UpdateChromeDriver import os_type
print(os_type())
获取当前谷歌游览器的版本:
from UpdateChromeDriver import get_browser_version_from_os
print(get_browser_version_from_os())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file UpdateChromeDriver-0.0.3.tar.gz
.
File metadata
- Download URL: UpdateChromeDriver-0.0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dfdebe9e7f388336828047cc9aa6af453c58ebc57b3892d1a1c13a3f32c81e0 |
|
MD5 | e981b85b93ec691e70b695d8bb8037cd |
|
BLAKE2b-256 | 12b0f05871f7ef6f84b3f4dcf49c22bf4c126ec7566f991b8095c542e91306aa |
File details
Details for the file UpdateChromeDriver-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: UpdateChromeDriver-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17acee8e29aa71e2077127254e80730462bbbd9355dd3b26f1d21b3b5866c0b |
|
MD5 | 7a13502c72e0a4796fc034f770d45ef0 |
|
BLAKE2b-256 | 1ca68eacfb09c8bb584cba881c2bbb6d0b55d88b1cae479adec4a0e588890f28 |