check-chromedriver

Check and update chromedriver for selenium automatically


Keywords
selenium, chromdriver, auto, download
Install
pip install check-chromedriver==2.0.26

Documentation

ํ•œ๊ตญ์–ด, 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.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)

cc = Check_Chromedriver()
cc.main()

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

cc = Check_Chromedriver("./your own path")
cc.main()
  1. Just Check

If you just want to check whether the driver works so that you can download whatever the version you want, you can say. If it says True, it is good to go.

cc = Check_Chromedriver()
isUsable = cc.check_driver()
print(isUsable)

Check_Chromedriver

์…€๋ ˆ๋‹ˆ์›€์„ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•  ๋•Œ ๊ธฐ์กด์— ๋ฐ›์•„ ๋†“์€ ํฌ๋กฌ ๋“œ๋ผ์ด๋ฒ„ ๋ฒ„์ „์ด ๋งŒ๋ฃŒ๋˜์–ด์žˆ๋‹ค๋ฉด, ์ƒˆ๋กœ ๋‹ค์šด๋ฐ›๋Š” ๊ฒƒ์ด ์—ฌ๊ฐ„ ๊ท€์ฐฎ์€ ์ผ์ด ์•„๋‹ˆ๋‹ค.

์ด๋Š” ํฌ๋กฌ ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๋ณด์•ˆ ๋“ฑ์˜ ์ด์œ ๋กœ ์ž๋™์œผ๋กœ ๋ธŒ๋ผ์šฐ์ € ์—…๋ฐ์ดํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ธฐ ๋•Œ๋ฌธ์ธ๋ฐ, ํ•„์ž๋Š” ์ด ๋ณด์•ˆ ์—…๋ฐ์ดํŠธ๋ฅผ ๋ง‰์Œ์œผ๋กœ์จ ์œ„ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ๋ณด๋‹ค๋Š”, ๊ฐ„๋‹จํ•œ ๋ชจ๋“ˆ์„ ํ†ตํ•ด ํฌ๋กฌ๋“œ๋ผ์ด๋ฒ„๋ฅผ ์ž๋™์œผ๋กœ ๋‹ค์šด๋ฐ›๊ฒŒ ํ•จ์œผ๋กœ์จ ํ•ญ์ƒ ์ตœ์‹  ๋ฒ„์ „์„ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ–ˆ๋‹ค.

โ€ป ์œˆ๋„์šฐ์—์„œ๋งŒ ์ž‘๋™ ๊ฐ€๋Šฅ

์„ค์น˜

  1. ์„ค์น˜
$ pip install check-chromedriver
  1. ๋ชจ๋“ˆ import
from Check_Chromedriver.Check_Chromedriver import Check_Chromedriver

์‚ฌ์šฉ ์˜ˆ

  1. ๋ฒ„์ „ ์ฒดํฌ ๋ฐ ์ž๋™ ๋‹ค์šด๋กœ๋“œ

ํ˜„์žฌ ๋ฃจํŠธ์— ํฌ๋กฌ๋“œ๋ผ์ด๋ฒ„๊ฐ€ ์กด์žฌํ•˜๋Š”์ง€ ๋˜๋Š” ์กด์žฌํ•œ๋‹ค๋ฉด ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ์ง€ ์ฒดํฌํ•œ ํ›„ ์•ˆ์ •์ ์ธ ์ตœ์‹  ๋ฒ„์ „์˜ ํฌ๋กฌ๋“œ๋ผ์ด๋ฒ„๋ฅผ ๋‹ค์Œ ๋ฃจํŠธ์— ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค.(./chromedriver/chromedriver.exe)

cc = Check_Chromedriver()
cc.main()

./chromedriver/chromedriver.exe ๋ฃจํŠธ๊ฐ€ ์•„๋‹Œ ์ž์‹ ๋งŒ์˜ ๋ฃจํŠธ๋ฅผ ๋งŒ๋“ค๊ณ ์‹ถ๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์ž‘์„ฑ...

cc = Check_Chromedriver("./your own path")
cc.main()
  1. ๋ฒ„์ „๋งŒ ์ฒดํฌ

ํ˜„์žฌ ๋ฒ„์ „์ด ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ์ง€ ์ฒดํฌ๋งŒ ํ•˜๊ณ  ๋‹ค์šด๋กœ๋“œ๋Š” ์ง์ ‘ ํ•˜๊ณ ์‹ถ๋‹ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•œ๋‹ค. True๊ฐ€ ๋ฐ˜ํ™˜๋œ๋‹ค๋ฉด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์˜๋ฏธ

cc = Check_Chromedriver()
isUsable = cc.check_driver()
print(isUsable)