본문 바로가기
Programming/Python Exceptions

Python - DeprecationWarning: executable_path has been deprecated, please pass in a Service object 오류

by 똘망파파 2021. 10. 25.

Selenium 사용 시 아래와 같은 소스에서 오류가 발견 됨.
뭐로 바뀐거지?


import selenium
from selenium import webdriver  

URL = 'https://google.com'

driver = webdriver.Chrome(executable_path='drivers/chromedriver')  
driver.implicitly_wait(time_to_wait=3)  
driver.get(url=URL)

아래 방식으로 변경 후 정상 작동


import selenium  
from selenium import webdriver

URL = 'https://google.com'

driverService = Service(ChromeDriverManager().install())  
driver = webdriver.Chrome(service=driverService)  
driver.implicitly_wait(time_to_wait=3)  
driver.get(url=URL)

댓글