프로그래밍/python
python chromedriver.exe autodownload
콘솔워크
2023. 10. 5. 16:41
반응형
chromedriver_autoinstaller 가 더이상 동작하지 않는다.
그래서 새로운 라이브러리를 찾아보던중 발견하였다.
pip install get_chrome_driver
위의 패키지를 설치하면 끝이다.
import time
from get_chrome_driver import GetChromeDriver
from selenium import webdriver
# Install the driver:
# Downloads ChromeDriver for the installed Chrome version on the machine
# Adds the downloaded ChromeDriver to path
get_driver = GetChromeDriver()
get_driver.install()
# Print the stable version
print(get_driver.stable_version())
# Print the stable version download link
print(get_driver.stable_version_url())
# Use the installed ChromeDriver with Selenium
driver = webdriver.Chrome()
driver.get("https://google.com")
time.sleep(3)
driver.quit()
위의 코드를 실행하면
chromedriver/크롬버전/bin 폴더에 chromedriver.exe 파일이 생성된다.
반응형