웹 자동화 프로그램 만들기 17 - chromedriver 따로 다운받지 않고 chromedriver사용하기

하이루·2022년 9월 26일
0

최신의 pycharm에서는 새로운 기능이 생겼는데,

driver = webdriver.Chrome('chromedriver.exe', options=option)

기존과 같이 chromedriver를 크롬 버전에 맞게 받아서 위와 같이 경로를 써줄 필요 없이

아래와 같이 해주면 알아서 버전에 맞는 크롬을 받아서 사용해준다.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

    driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=option)
profile
ㅎㅎ

0개의 댓글