인프런 커뮤니티 질문&답변
궁금해요
작성
·
384
0
from selenium import webdriver
import time
url = "https://search.naver.com/search.naver?where=image&sm=tab_jum&query=%EA%B0%95%EB%AF%BC%EA%B2%BD"
browser = webdriver.Chrome("C:/chromedriver.exe")
browser.implicitly_wait(10)
browser.maximize_window()
browser.get(url)
이걸 입력 후
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. 새로운 크로스 플랫폼 PowerShell 사용 https://aka.ms/pscore6 PS C:\crawliling> & C:/Users/조진오/AppData/Local/Programs/Python/Python38/python.exe c:/crawliling/chapter07/01.이미 지주소추출.py c:/crawliling/chapter07/01.이미지주소추출.py:13: DeprecationWarning: executable_path has been deprecated, please pass in a Service object browser = webdriver.Chrome("C:/chromedriver.exe") Traceback (most recent call last): File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] 지정된 파일을 찾을 수 없습니다 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:/crawliling/chapter07/01.이미지주소추출.py", line 13, in <module> browser = webdriver.Chrome("C:/chromedriver.exe") File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__ super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog", File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 90, in __init__ self.service.start() File "C:\Users\조진오\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home PS C:\crawliling>
이렇게 뜨는데 무슨 뜻인가여.. 혹시나 해서 pip install
selenium 하고 했는데도 이렇게 뜹니다
퀴즈
고유 ID나 클래스가 없는 태그의 셀렉터는 어떻게 찾는 것이 좋을까요?
임의의 클래스 이름을 새로 만듭니다.
부모 태그를 찾고 자식 셀렉터 등을 활용해 위치를 지정합니다.
태그 이름만 사용하여 모든 요소를 가져옵니다.
해당 태그는 크롤링할 수 없으므로 넘어갑니다.
답변 1
0
스타트코딩
지식공유자
DeprecationWarning
Deprecated : "사용이 권장되지 않는" 이라는 뜻입니다.
앞으로 개발 할 때 종종 보게될 메시지 인데요.
오류가 아니라,
새로운 방식으로 업데이트 되었으니 예전 방식을 그만 써줘라고 권장하는 겁니다.
셀레니움 4버전으로 업데이트 되면서
새로운 방식으로 드라이버를 설치하고 사용하는 것을 권장하고 있습니다.
해당 내용은
강의소개 - (BONUS) 셀레니움 4 가이드 강의에서 다뤄 드리고 있으니 참고 부탁드립니다 ^^





