* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
크롤링 값이 뜨질 않아요.
작성한 코드 및 에러 메세지
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging"])
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://www.google.com/search?q=애플 주식")
name=driver.find_element(By.CLASS_NAME, "DoxwDb").text
price=driver.find_element(By.CSS_SELECTOR,".IsqQVc").text
high_price=driver.find_element(By.CSS_SELECTOR,'div[data-attrid="최고"]').text
low_price=driver.find_element(By.CSS_SELECTOR,'div[data-attrid="최저"]').text
print(f"주식명: {name}")
print(f"가격: {price}")
print(f"최고가: {high_price}")
print(f"최저가: {low_price}")
오류 발생 시, 작성한 코드 전체와 에러 메시지를 첨부해 주세요.
Tip 1) </> 아이콘을 눌러 코드박스를 만들어 보세요.
Tip 2) Ctrl+A(맥의 경우 Command+A) 단축키로 코드를 한 번에 선택할 수 있어요!