
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
똑같이 따라했는데 안되네요.
웹사이트는 떴다가 꺼지는데 터미널에 글자가 안 뜹니다.
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://product.kyobobook.co.kr/bestseller/online?period=001&page=1&per=50")
books_elements = driver.find_elements(By.CLASS_NAME, 'prod_item')
for index, book in enumerate(books_elements):
rank = index + 1 # 0부터 시작하니까 +1을 해서 첫번째가 1이 되도록 설정
title = book.find_element(By.CLASS_NAME, 'prod_info').text
author = book.find_element(By.CLASS_NAME, 'prod_author').text
price = book.find_element(By.CLASS_NAME, 'price').text
print(f"{rank}등 {title}, by {author} 가격 {price}")
driver.quit()

