ํ๊ตญ์ด, 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
- Install
$ pip install check-chromderiver
- Simply import the module
from Check_Chromedriver.Check_Chromedriver import Check_Chromedriver
Sample Usage
- 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()
- 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
์ ๋ ๋์์ ์ฌ์ฉํ๋ ค๊ณ ํ ๋ ๊ธฐ์กด์ ๋ฐ์ ๋์ ํฌ๋กฌ ๋๋ผ์ด๋ฒ ๋ฒ์ ์ด ๋ง๋ฃ๋์ด์๋ค๋ฉด, ์๋ก ๋ค์ด๋ฐ๋ ๊ฒ์ด ์ฌ๊ฐ ๊ท์ฐฎ์ ์ผ์ด ์๋๋ค.
์ด๋ ํฌ๋กฌ ๋ธ๋ผ์ฐ์ ๊ฐ ๋ณด์ ๋ฑ์ ์ด์ ๋ก ์๋์ผ๋ก ๋ธ๋ผ์ฐ์ ์ ๋ฐ์ดํธ๋ฅผ ์งํํ๊ธฐ ๋๋ฌธ์ธ๋ฐ, ํ์๋ ์ด ๋ณด์ ์ ๋ฐ์ดํธ๋ฅผ ๋ง์์ผ๋ก์จ ์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ธฐ๋ณด๋ค๋, ๊ฐ๋จํ ๋ชจ๋์ ํตํด ํฌ๋กฌ๋๋ผ์ด๋ฒ๋ฅผ ์๋์ผ๋ก ๋ค์ด๋ฐ๊ฒ ํจ์ผ๋ก์จ ํญ์ ์ต์ ๋ฒ์ ์ ์ ์งํ ์ ์๋๋ก ํ๋ค.
โป ์๋์ฐ์์๋ง ์๋ ๊ฐ๋ฅ
์ค์น
- ์ค์น
$ pip install check-chromedriver
- ๋ชจ๋ import
from Check_Chromedriver.Check_Chromedriver import Check_Chromedriver
์ฌ์ฉ ์
- ๋ฒ์ ์ฒดํฌ ๋ฐ ์๋ ๋ค์ด๋ก๋
ํ์ฌ ๋ฃจํธ์ ํฌ๋กฌ๋๋ผ์ด๋ฒ๊ฐ ์กด์ฌํ๋์ง ๋๋ ์กด์ฌํ๋ค๋ฉด ์ฌ์ฉ๊ฐ๋ฅํ์ง ์ฒดํฌํ ํ ์์ ์ ์ธ ์ต์ ๋ฒ์ ์ ํฌ๋กฌ๋๋ผ์ด๋ฒ๋ฅผ ๋ค์ ๋ฃจํธ์ ๋ค์ด๋ก๋ํ๋ค.(./chromedriver/chromedriver.exe)
cc = Check_Chromedriver()
cc.main()
./chromedriver/chromedriver.exe ๋ฃจํธ๊ฐ ์๋ ์์ ๋ง์ ๋ฃจํธ๋ฅผ ๋ง๋ค๊ณ ์ถ๋ค๋ฉด ์๋์ ๊ฐ์ด ์์ฑ...
cc = Check_Chromedriver("./your own path")
cc.main()
- ๋ฒ์ ๋ง ์ฒดํฌ
ํ์ฌ ๋ฒ์ ์ด ์ฌ์ฉ๊ฐ๋ฅํ์ง ์ฒดํฌ๋ง ํ๊ณ ๋ค์ด๋ก๋๋ ์ง์ ํ๊ณ ์ถ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์์ฑํ๋ค. True๊ฐ ๋ฐํ๋๋ค๋ฉด ์ฌ์ฉ ๊ฐ๋ฅํ๋ค๋ ์๋ฏธ
cc = Check_Chromedriver()
isUsable = cc.check_driver()
print(isUsable)