Skip to main content

自动更新driver文件,提高selenium代码的稳定性

Project description

介绍

浏览器的更新和driver文件的版本异常,经常是影响代码稳定性的一个原因,而每次driver文件的更新也是比较繁杂的工作,此次的safe-driver意在帮助维护driver的稳定性

作用

safe-driver导入后,可替换selenium的webdriver,使用方式和方法同selenium的webdriver 当启动浏览器driver文件出错时,程序将自动下载并更新浏览器驱动,并重新返回driver,提高代码的稳定性

导入

from SafeDriver.drivers import driver
from SafeDriver.drivers import option

使用

此操作同selenium的webdriver.Chrome()

driver = driver()
driver.get("https://www.baidu.com")

放入options参数

首先确定导入option配置参数 使用同selenium的ChromeOptions,可直接添加,添加后,无需再次写入到driver中

from SafeDriver.drivers import option
option.add_argument('--headless')

目前仅支持windows的chrome浏览器,暂未更新其他系统和浏览器

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

SafeDriver-0.0.4.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

SafeDriver-0.0.4-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file SafeDriver-0.0.4.tar.gz.

File metadata

  • Download URL: SafeDriver-0.0.4.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for SafeDriver-0.0.4.tar.gz
Algorithm Hash digest
SHA256 297ad3aaf4c0e5508f6b455d80274d228c677b9a9c2ebe89b0a9ffd77f74e814
MD5 d3974b91c83436059578de95fa35c9d9
BLAKE2b-256 fecf9e3e296d2b1c82f0e9b56c408d164859131c02ca4069381446243151fedf

See more details on using hashes here.

File details

Details for the file SafeDriver-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: SafeDriver-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for SafeDriver-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4e7895355e0f04a07ddcf2175dfe92b2765f08f3690e10bcddc13b80a4893e
MD5 d686252d0b4408cad3e1efba7d4df393
BLAKE2b-256 353f9873287713ebc1fdc39a2cf497bef3d0346866f9b9a4d0005b074f0b74c8

See more details on using hashes here.

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