from selenium import webdriver
driver = webdriver.Chrome('<driver path>')
driver.get()
셀레니움을 사용하기 위해 chromedriver를 다운로드 했습니다.
하지만 드라이버를 인스턴스화하기 위해 위 코드를 실행한 결과 에러가 발생했습니다.
NoSuchDriverException: Message: Unable to obtain chromedriver using Selenium Manager;
Selenium 매니저가 드라이버를 인식하지 못하기 때문에 발생하는 문제였습니다.
다행히도 아래 스택오버플로우에서 문제해결책을 찾았습니다.
Selenium 일정 버전(v4.6.0) 이상 사용자들은 chromedriver가 위치한 path를 명시하지 않아도 됩니다.
from selenium import webdriver
driver = webdriver.Chrome()
driver.get()
<driver path>를 명시하지 않고 코드를 실행한 결과 더이상 에러가 발생하지 않았습니다.
'파이썬・ML' 카테고리의 다른 글
파이썬 collections 모듈 Counter 사용하기 (0) | 2023.07.26 |
---|---|
Selenium 사용하기 (0) | 2023.07.07 |
파이썬 Folium으로 지도 시각화하기 (0) | 2023.07.04 |
파이썬 random 모듈 사용하기 (0) | 2023.06.14 |
파이썬 객체에 대해서 (0) | 2023.06.05 |