• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    미해결

셀레니움 정상 작동 되다가 오늘부로 갑자기 오류가 발생

23.07.20 20:28 작성 조회수 14.8k

2

안녕하세요. 강의를 잘 수강하고 있습니다.

다름이 아니라 셀레니움으로 작성했던 코드들이 정상적으로 모두 잘 작동되다가 오늘부로 갑자기 오류가 발생하여 문의드립니다!

오류를 해결하기 위해 버전 업그레이드도 모두 하였고, 재부팅도 해보았지만 셀레니움으로 작성했던 모든 코드들에서 맨 아래와 같은 오류가 발생했습니다 ㅠㅠ

 

코드는 아래와 같습니다.

# -*- coding: utf-8 -*-

# 외우는거 아님. 그냥 필요할 때 복붙
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

# 크롬 드라이버 자동 업데이트
from webdriver_manager.chrome import ChromeDriverManager

#브라우저 꺼짐 방지 
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)

# 불필요한 에러 메시지 없애기
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging"])

service = Service(executable_path=ChromeDriverManager().install())
browser = webdriver.Chrome(service=service, options=chrome_options)

# 웹페이지 해당 주소 이동
browser.get("https://www.naver.com")

오류 메시지는 다음과 같습니다.

Traceback (most recent call last):

File "c:\pratice_crolling\실습4_셀레니움 기본 설정\[기초복붙용]셀레니움 기본 설정.py", line 21, in <module>

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py", line 39, in install

driver_path = self._get_driver_path(self.driver)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py", line 30, in getdriver_path

file = self._download_manager.download_file(driver.get_driver_download_url())

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 40, in get_driver_download_url

driver_version_to_download = self.get_driver_version_to_download()

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\driver.py", line 51, in get_driver_version_to_download

self._driver_to_download_version = self._version if self._version not in (None, "latest") else self.get_latest_release_version()

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 62, in get_latest_release_version

resp = self._http_client.get(url=latest_release_url)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 37, in get

self.validate_response(resp)

File "C:\Users\hyeonseok\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 16, in validate_response

raise ValueError(f"There is no such driver by url {resp.url}")

ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790

답변 6

·

답변을 작성해보세요.

3

minuzai님의 프로필

minuzai

2023.07.21

Chrome-for-Tesing 버전이 기존 114 에서 115로 바뀌어서 그런거 같습니다.
https://googlechromelabs.github.io/chrome-for-testing/

암튼 ChromeDriverManager().install() 이 부분을

ChromeDriverManager(version="114.0.5735.90").install() 와 같이

버전을 명시하시면 latest 가 아닌 114버전으로 설치되실거에요.

저는 변경하고 나서 정상 작동 확인했습니다.

hhs0995님의 프로필

hhs0995

질문자

2023.07.27

도움을 주셔서 감사합니다. 해결되었습니다.

1

코크님의 프로필

코크

2023.07.27

크롬이 115 버전으로 업데이트 되었는데요, 크롬 드라이버는 114가 현재 최신 버전이며, 업데이트 되지 않았습니다. ChromeDriverManager().install() 소스 코드를 파고 드시면, 현재 크롬 버전을 가져오는 부분이 있는데 그 부분이 현재 사용자의 크롬 정보를 토대로 가져오도록 되어있습니다.

115 버전의 크롬 드라이버 path 를 구글 크롬드라이버 저장소 에서 받아오는데, 해당 path 가 존재하지 않으니 드라이버 다운로드 실패되는 겁니다.

버전을 직접 명시해주시는 방법이 있고,

https://cokes.tistory.com/190

버전 오류가 발생하면 마지막 릴리즈 버전을 받아와 해당 버전을 지정해주는 방법이 있겠네요.

0

안녕하세요

코딩을 가장 쉽게 알려주는 크리에이터,

스타트코딩입니다!

 

크롬 버전은 115인데

크롬 드라이버 매니저에서 115를 설치하지 못해 발생하는 현상으로 보입니다.

 

크롬 드라이버 매니저를 사용하지 않고

아래 코드로 수정해 보세요 :)

# 외우는거 아님. 그냥 필요할 때 복붙
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

# 크롬 드라이버 자동 업데이트
from webdriver_manager.chrome import ChromeDriverManager

#브라우저 꺼짐 방지 
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)

# 불필요한 에러 메시지 없애기
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging"])
browser = webdriver.Chrome(options=chrome_options)

# 웹페이지 해당 주소 이동
browser.get("https://www.naver.com")

0

bhave님의 프로필

bhave

2023.07.25

service = Service(executable_path=ChromeDriverManager().install()) 줄을
service = Service() 로 고쳐보세요. 이러면 크롬브라우저를 다운그레이드하지 않아도 동작합니다.
출처: https://stackoverflow.com/questions/76724939/there-is-no-such-driver-by-url-https-chromedriver-storage-googleapis-com-lates

hhs0995님의 프로필

hhs0995

질문자

2023.07.27

도움을 주셔서 감사합니다. 해결되었습니다.

0

Fridays Prize님의 프로필

Fridays Prize

2023.07.21

크롬 버전이 문제네요. 115. 버전... 자동 업데이트 된 것 같은데..

삭제 후 이전 버전으로 재 설치하니 에러 없어졌습니다.

0

정진수님의 프로필

정진수

2023.07.20

헉... 저도 작년부터 쓰던 코드 갑자기 오늘 똒같은 에러 뜨면서 안되네요... 구글링해봐도 명확한 해결법이 안나와요 ㅜㅜ