Skip to main content

Check and update chromedriver for selenium automatically

Project description

한국어, english

Check_Chromedriver

It is always annoying to know that your Chromedriver is expired especially when you want to use Selenium.

I found that this happends because chrome browser updates itself automatically for its security's sake.

Rather than making it not to update by itself, I made a module that checks and updates Chromedirver's version.

※ It only works on Windows

Install

  1. Install
$ pip install check-chromderiver
  1. Simply import the module
from Check_Chromedriver import Check_Chromedriver

Sample Usage

  1. Check and Download

This will automatically check not only whether your Chromedriver exists in your directory but also whether it is good to use. It downloads latest stable version of Chromedriver in your root directory. (./chromedriver/chromedriver.exe)

Check_Chromedriver.main()

if you want to make your own directory, you can say...

Check_Chromedriver.driver_mother_path = "./your own path"
Check_Chromedriver.main()

Check_Chromedriver

셀레니움을 사용하려고 할 때 기존에 받아 놓은 크롬 드라이버 버전이 만료되어있다면, 새로 다운받는 것이 여간 귀찮은 일이 아니다.

이는 크롬 브라우저가 보안 등의 이유로 자동으로 브라우저 업데이트를 진행하기 때문인데, 필자는 이 보안 업데이트를 막음으로써 위 문제를 해결하기보다는, 간단한 모듈을 통해 크롬드라이버를 자동으로 다운받게 함으로써 항상 최신 버전을 유지할 수 있도록 했다.

※ 윈도우에서만 작동 가능

설치

  1. 설치
$ pip install check-chromedriver
  1. 모듈 import
from Check_Chromedriver import Check_Chromedriver

사용 예

  1. 버전 체크 및 자동 다운로드

현재 루트에 크롬드라이버가 존재하는지 또는 존재한다면 사용가능한지 체크한 후 안정적인 최신 버전의 크롬드라이버를 다음 루트에 다운로드한다.(./chromedriver/chromedriver.exe)

Check_Chromedriver.main()

./chromedriver/chromedriver.exe 루트가 아닌 자신만의 루트를 만들고싶다면 아래와 같이 작성...

Check_Chromedriver.driver_mother_path = "./your own path"
Check_Chromedriver.main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

check_chromedriver-2.0.26-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file check_chromedriver-2.0.26-py3-none-any.whl.

File metadata

  • Download URL: check_chromedriver-2.0.26-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for check_chromedriver-2.0.26-py3-none-any.whl
Algorithm Hash digest
SHA256 cc116dc902a65afbacb7fe303260b98cc014d63c0998ca2c3b0516a7e12e9351
MD5 c2fed12207e718d51186542388d50729
BLAKE2b-256 de17d473d5559180c620973e2a1c4670a25d678fc2f1c0cf88aa09c8e8c909b0

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