컴퓨터에 설치된 크롬과

ChromeDriver의 버전이 맞지 않아서 발생한 오류

 

해결방법은

-> 두 버전을 동일하게 맞춰주면 된다.

 

파이썬에서 ChromeDriver 를 호출하게 되면

This version of ChromeDriver only supports Chrome version 85 와 같이 메시지가 나오게 된다.

 

위 의미는 지금 ChromeDriver의 버전은 85 라는 것이고,

현재 컴퓨터에 설치된 Chrome은 버전이 85가 아니라는 얘기이다.

 

그럼 둘 중에 하나의 버전을 동일하게 맞춰주면 된다.

좀 더 쉬운 방법은 ChromeDriver의 버전을 맞춰주는 것

왜냐면 ChromeDriver 다운로드 사이트는 버전별로 제공해주고 있으니까

 

아래가 그 사이트이다.

 

sites.google.com/a/chromium.org/chromedriver/downloads

 

(X) pip install cv2

 

 

(O) pip install opencv-python

 

 

and...

 

 

import cv2

from urllib.request import urlopen
from bs4 import BeautifulSoup

 

html = urlopen('http://www.naver.com/')
bsObject = BeautifulSoup(html,"html.parser")

title_list = bsObject.select('.PM_CL_realtimeKeyword_rolling .ah_k')
for i, title in enumerate(title_list):
    print(i+1, ":" , title.get_text())

 

#####################

# drag from here for test  #

#####################

import openpyxl

 

# open excel file

wb = openpyxl.load_workbook('excel_file_name.xlsx')

 

# read active sheet

ws = wb.active

    # (another mothod) read sheet by name

    # ws = wb.get_sheet_by_name("Sheet1")

 

 

# read row data

count = 1;
for r in ws.rows:

    if not r[0].value:

        # (another mothods) check None data of Excel

        # if r[0].value == None:

        # if r[0].value is None:

        print("row[", count , "].value : None")

 

    count++

 

 

# close opened Excel file

wb.close()

###################

# drag to here for test  #

###################

 

 

 

 

- excel_file_name.xlsx

 

Execution result

 

+ Recent posts