from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

from bs4 import BeautifulSoup
import requests

url = 'http://www.yes24.com/Main/default.aspx'
driver = webdriver.Chrome()
driver.get(url)

elem = driver.find_element(By.ID, 'query')
elem.send_keys('파이썬')

elem = driver.find_element(By.XPATH, '//*[@id="yesSForm"]/fieldset/span[2]/button')
#elem.send_keys(Keys.ENTER)
elem.click()
C:\Users\kilah\anaconda3\lib\site-packages\requests\__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
# 데이터 가져오기
soup = BeautifulSoup(driver.page_source, 'lxml')

book_list = soup.find('ul', attrs={'id': 'yesSchList'})

books = book_list.find_all('li')

for i, book in enumerate(books) : 
    title = book.find('a', attrs={'class' : 'gd_name'})
    price = book.find('strong', attrs={'class' : 'txt_num'})
    
    rating = book.select('span.rating_grade em')
    if not rating : continue
    
    if float(rating[0].get_text()) < 9.6 : continue
        
    print(title.get_text(), price.get_text(), rating[0].get_text())
Do it! 점프 투 파이썬 16,920원 9.6
혼자 공부하는 머신러닝+딥러닝 23,400원 10.0
Do it! 점프 투 파이썬 + Do it! 파이썬 생활 프로그래밍 34,920원 9.6
파이썬 코딩의 기술(개정2판) 28,800원 9.6
Do it! 자료구조와 함께 배우는 알고리즘 입문 : 파이썬 편 19,800원 9.6
Do it! 점프 투 파이썬 + Do it! 자료구조와 함께 배우는 알고리즘 입문 : 파이썬 편 + Do it! 파이썬 생활 프로그래밍 54,720원 9.6
Do it! 점프 투 파이썬 + Do it! 첫 파이썬  29,520원 9.6
Do it! 첫 파이썬 12,600원 9.7
파이썬 증권 데이터 분석  28,800원 9.6
쉽게 따라 만드는 파이썬 주식 자동매매 시스템 25,200원 9.6
모두의 인공지능 with 파이썬 19,800원 10.0