Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8장 DynamicPageScraping_NaverETF.py의 ChromeDiver 문제 #163

Open
hotdoji opened this issue Sep 20, 2022 · 1 comment
Open

8장 DynamicPageScraping_NaverETF.py의 ChromeDiver 문제 #163

hotdoji opened this issue Sep 20, 2022 · 1 comment

Comments

@hotdoji
Copy link

hotdoji commented Sep 20, 2022

안녕하세요 거의 완독 중인 학생입니다.!
깃허브에 에러가 거의 다 있어서 여태까지 도움 받아 잘 왔지만 처음으로 직접 질문을 올리게 되었습니다.
조금 설명이 긴 점 양해 부탁드립니다.

8.4.1의 네이버 ETF 정보 스크레이핑 단계에서

32비트 가상환경에 selenium 설치 후
chrome 버전 확인 결과 105.0.5195.127 이었습니다.
그리고 책에 적힌 구글드라이버 주소에 들어가니 새 주소로 변경되었다고 하여
https://sites.google.com/chromium.org/driver/ 여기의 Downloads 탭에서
105.0.5195.127 버전을 찾았으나 없었고
If you are using Chrome version 105, please download [ChromeDriver 105.0.5195.52] 라고 되어있기에
ChromeDriver 105.0.5195.52 [chromedriver_win32.zip] 을 다운하여 chromedriver.exe 를 C:\myPackage 에 붙여 넣었습니다.
그리고 python.exe, idle.exe, chromedriver.exe 관리자 권한으로 다 바꾸었습니다.
그리고 DynamicPageScraping_NaverETF.py 코드 그대로 실행하였으나 다음과 같은 에러가 발생했습니다.

Traceback (most recent call last):
File "C:\myPackage\ch08_02_DynamicPageScraping_NaverETF.py", line 10, in
drv = webdriver.Chrome('C:\myPackage\chromedriver.exe', options=opt)
File "C:\VirtualEnv\Py380_32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init
RemoteWebDriver.init(
File "C:\VirtualEnv\Py380_32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init
self.start_session(capabilities, browser_profile)
File "C:\VirtualEnv\Py380_32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\VirtualEnv\Py380_32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\VirtualEnv\Py380_32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

읽어보니 짐작할 수 있는 것은 정확히 105.0.5195.127 버전의 chromedriver가 아닌 것이 문제 같은데
여기서 질문이 있습니다.
이를 해결하기 위해 크롬을 일부러 105.0.5195.52 같은 버전으로 다운그레이드하고 크롬의 자동 업데이트를
중지시켜야 하는 것인가요?
그렇다면 이 스크레이핑을 유지하기 위해서는 계속 업데이트가 불가능한 상태로 유지해야 하는 수 밖에 없는 것인지 궁금합니다.
감사합니다.

@INVESTAR
Copy link
Owner

Chrome 105.0.5195.127 버전이면 미국 시각으로 9월 14일부터 자동 업데이트 중인 비교적 최신 버전이긴 한데
9월 27일부터 또다시 106.0.5249.62 버전으로 메이저 버전 업데이트가 시작된 것으로 알고 있습니다.

Chrome 버전업이 이루어질 때마다 ChromeDriver 버전업을 하는 구조가 아니기 때문에
최신 버전의 Chrome 브라우저에 대한 ChromeDriver의 지원 여부는 복불복인 것 같습니다.

스크레이핑을 안정적으로 유지하려면, 어쩔 수 없이 ChromeDriver가 지원하는 버전의 크롬 브라우저를 설치하시고
작업스케줄러에서 크롬 자동 업데이트를 중지시키는 수 밖에 없을 것으로 예상됩니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants