728x90
크롬 드라이브를 실행할 때 executable_path를 이용해서 열었더니 다음과 같은 에러가 발생했다.

해결방법은 다음과 같다.
1. webdriver-manager를 설치
pip install webdriver-manager
2. ChromeDriverManager를 이용하여 해당 Chrome버전에 맞는 chromedriver를 이용할 수 있게 한다
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
def init_chrome_driver():
chrome_options = webdriver.ChromeOptions()
chrome_driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
return chrome_driver
driver = init_chrome_driver()
url = 'https://www.google.com/'
driver.get(url)
Reference
https://velog.io/@sangyeon217/deprecation-warning-executablepath-has-been-deprecated
728x90
'Python' 카테고리의 다른 글
[pyautogui] click, keyDown, press not working, python 관리자 권한으로 실행 (0) | 2022.08.19 |
---|---|
[selenium] NoSuchElementException 해결 방법 (0) | 2022.08.19 |
[selenium] cookie 설정 방법 (0) | 2022.08.19 |
[selenium] no such element: Unable to locate element (0) | 2022.08.19 |
스크래핑을 입문자의 공부 기록 (0) | 2022.08.19 |
728x90
크롬 드라이브를 실행할 때 executable_path를 이용해서 열었더니 다음과 같은 에러가 발생했다.

해결방법은 다음과 같다.
1. webdriver-manager를 설치
pip install webdriver-manager
2. ChromeDriverManager를 이용하여 해당 Chrome버전에 맞는 chromedriver를 이용할 수 있게 한다
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
def init_chrome_driver():
chrome_options = webdriver.ChromeOptions()
chrome_driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
return chrome_driver
driver = init_chrome_driver()
url = 'https://www.google.com/'
driver.get(url)
Reference
https://velog.io/@sangyeon217/deprecation-warning-executablepath-has-been-deprecated
728x90
'Python' 카테고리의 다른 글
[pyautogui] click, keyDown, press not working, python 관리자 권한으로 실행 (0) | 2022.08.19 |
---|---|
[selenium] NoSuchElementException 해결 방법 (0) | 2022.08.19 |
[selenium] cookie 설정 방법 (0) | 2022.08.19 |
[selenium] no such element: Unable to locate element (0) | 2022.08.19 |
스크래핑을 입문자의 공부 기록 (0) | 2022.08.19 |