[파이썬]크롬드라이버 최신상태 유지방법 1
본문 바로가기
IT/파이썬

[파이썬]크롬드라이버 최신상태 유지방법 1

by SageIN 2022. 2. 18.
반응형

크롬 드라이버 버전이 안 맞아서 오류가 나는 경우가 종종 있습니다.

드라이버 버전을 체크하고 최신상태로 유지합니다.

 

import chromedriver_autoinstaller
    chrome_ver = chromedriver_autoinstaller.get_chrome_version().split('.')[0]
    driver_path = f'./{chrome_ver}/chromedriver.exe'
    if os.path.exists(driver_path):
        print(f"chrom driver is insatlled: {driver_path}")
    else:
        print(f"install the chrome driver(ver: {chrome_ver})")
        chromedriver_autoinstaller.install(True)

 

반응형

댓글


TOP

Designed by 티스토리