[Error]Message: session not created: This version of ChromeDriver only supports Chrome version 96
pg = 3
url = 'https://news.naver.com/main/main.naver?mode=LSD&mid=shm&sid1=101#&date=%2000:00:00&page={}'.format(pg)
driver = webdriver.Chrome()
driver.get(url)
---------------------------------------------------------------------------
SessionNotCreatedException Traceback (most recent call last)
C:\Users\Public\Documents\ESTsoft\CreatorTemp/ipykernel_17112/564688038.py in <module>
1 pg = 3
2 url = 'https://news.naver.com/main/main.naver?mode=LSD&mid=shm&sid1=101#&date=%2000:00:00&page={}'.format(pg)
----> 3 driver = webdriver.Chrome()
4 driver.get(url)
~\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, service, keep_alive)
68 service = Service(executable_path, port, service_args, service_log_path)
69
---> 70 super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
71 port, options,
72 service_args, desired_capabilities,
~\anaconda3\lib\site-packages\selenium\webdriver\chromium\webdriver.py in __init__(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive)
91
92 try:
---> 93 RemoteWebDriver.__init__(
94 self,
95 command_executor=ChromiumRemoteConnection(
~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
266 self.file_detector = file_detector or LocalFileDetector()
267 self.start_client()
--> 268 self.start_session(capabilities, browser_profile)
269
270 def __repr__(self):
~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in start_session(self, capabilities, browser_profile)
357 parameters = {"capabilities": w3c_caps,
358 "desiredCapabilities": capabilities}
--> 359 response = self.execute(Command.NEW_SESSION, parameters)
360 if 'sessionId' not in response:
361 response = response['value']
~\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params)
422 response = self.command_executor.execute(driver_command, params)
423 if response:
--> 424 self.error_handler.check_response(response)
425 response['value'] = self._unwrap_value(
426 response.get('value', None))
~\anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response)
245 alert_text = value['alert'].get('text')
246 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
--> 247 raise exception_class(message, screen, stacktrace)
248
249 def _value_or_default(self, obj: Mapping[_KT, _VT], key: _KT, default: _VT) -> _VT:
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 96
Current browser version is 100.0.4896.75 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
Ordinal0 [0x004C6903+2517251]
Ordinal0 [0x0045F8E1+2095329]
Ordinal0 [0x00362848+1058888]
Ordinal0 [0x00380B9D+1182621]
Ordinal0 [0x0037CA60+1165920]
Ordinal0 [0x0037A2CF+1155791]
Ordinal0 [0x003AAAAF+1354415]
Ordinal0 [0x003AA71A+1353498]
Ordinal0 [0x003A639B+1336219]
Ordinal0 [0x003827A7+1189799]
Ordinal0 [0x00383609+1193481]
GetHandleVerifier [0x00655904+1577972]
GetHandleVerifier [0x00700B97+2279047]
GetHandleVerifier [0x00556D09+534521]
GetHandleVerifier [0x00555DB9+530601]
Ordinal0 [0x00464FF9+2117625]
Ordinal0 [0x004698A8+2136232]
Ordinal0 [0x004699E2+2136546]
Ordinal0 [0x00473541+2176321]
BaseThreadInitThunk [0x762CFA29+25]
RtlGetAppContainerNamedObjectPath [0x77707A9E+286]
RtlGetAppContainerNamedObjectPath [0x77707A6E+238]
news = driver.find_elements_by_css_selector('#section_body li')
len(news)
---------------------------------------------------------------------------
오랜만에 Selenium을 실행했는데 위와 같은 오류가 발생했다.
Why?
크롬 버젼이 업데이트 됐으나 Selenium이 업데이트 안돼서 발생하는 문제이다.
해결
기존 설치된 Selenium의 버젼은
Chrome version 96에 적용되므로,
https://chromedriver.chromium.org/downloads
에서 버전 100에 해당하는 Selenium을 설치한다.
Author And Source
이 문제에 관하여([Error]Message: session not created: This version of ChromeDriver only supports Chrome version 96), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@htright/ErrorMessage-session-not-created-This-version-of-ChromeDriver-only-supports-Chrome-version-96저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)