inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

웹크롤링 webdriver.chrome에 오류가 생겨요..

1961

머식

작성한 질문수 1

0

웹크롤링으로 프로그램 하나 만드려고 하는데

Traceback (most recent call last):

File "c:\Users\cheon\Desktop\파이썬\web_crawling.py", line 19, in <module>

driver = webdriver.Chrome(service=service, options=chrome_options)

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

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 45, in init

super().__init__(

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 55, in init

self.service.start()

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\common\service.py", line 98, in start

self._start_process(self._path)

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\site-packages\selenium\webdriver\common\service.py", line 208, in startprocess

self.process = subprocess.Popen(

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

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in init

self._execute_child(args, executable, preexec_fn, close_fds,

File "C:\Users\cheon\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1538, in executechild

hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

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

OSError: [WinError 193] %1은(는) 올바른 Win32 응용 프로그램이 아닙니다

이런 오류가 떠요.. 크롬과 파이썬 둘 다 64비트인데...

일부 코드는 아래와 같습니다

import tkinter as tk
from tkinter import filedialog
from PIL import Image, ImageTk
import pytesseract
import re
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup

# Tesseract 경로 설정 (Windows의 경우)
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'

# 웹 크롤링 설정
chrome_options = Options()
chrome_options.add_argument("--headless")  # 브라우저 창을 열지 않음
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=chrome_options)
url = 'https://www.ebsi.co.kr/ebs/xip/xipa/retrieveSCVMainInfo.ebs?irecord=202407113&targetCd=D300&cookieGradeVal=high3'
driver.get(url)
html = driver.page_source
soup = BeautifulSoup(html, 'html.parser')
driver.quit()

답변 1

1

sun

저와 같은 증상이시네요, 아마 이번에 크롬 버전이 업데이트 되면서 발생하는 문제인 것 같습니다.
저도 아직 해결 중이라 방법 찾으면 공유드릴게요ㅜ

0

dlgustmddd

안녕하세요 혹시 해결 하셨나요...?

0

sun

네 ㅎㅎ service = Service() 이렇게 manager를 지워보시겠어요? 크롬이 업데이트 되면서 ChromeDriverManager를 사용 시 발생하는 문제라고 하네요

0

이하민

ChromeDriverManager는 사용 불가한걸까요??

0

투비프로

저도 궁금하네요 애초에 ChromeDriverManager가 알아서 드라이브 설치하고 버전관리도 해주는 걸로 알고 있는데..

강의 추천해주세요

2

27

1

케이테스트 서버 운영 방법

2

49

1

Navigation Mobile 토글 베리어블이 안됩니당

1

38

2

프로필 사진 세팅과 관련하여 질문 드립니다

1

48

2