Test Automation/Selenium
[이슈] DeprecationWarning: executable_path has been deprecated, please pass in a Service object
Nickoo
2021. 12. 15. 12:01
'Selenium webdriver 로 웹페이지 띄우기' 를 진행하며 chrome webdriver를 실행했는데, 아래와 같은 warning이 뜨는 경우가 있습니다.
DeprecationWarning: executable_path has been deprecated, please pass in a Service object
이런 경우 service 키워드를 사용하면 됩니다.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
driver.get(url='https://www.google.com/')
driver.quit()
아래는 실행 결과후 console 창에
참고 :