Kyobo Bookstore review crawl is not available.

Asked 2 weeks ago, Updated 2 weeks ago, 2 views

I'd like to get a list of Naver bestsellers (yes24) and go to the Kyobo Bookstore page of the book and get a Clover review (one-line review) from the page It's not working.

Only the annotated parts do not work properly. The code is executed, but it is printed as blank. I want to know how to get the review correctly.

//from selenium import webdriver
from import ChromeDriverManager
from bs4 import BeautifulSoup
import time

url = ""

driver = webdriver.Chrome(ChromeDriverManager().install())

bsObject = BeautifulSoup(driver.page_source, 'html.parser')

book_page_urls = []
for index in range(0, 25):
    dl_data = bsObject.find('dt', {'id':"book_title_"+str(index)})
    link ='a')[0].get('href')

for index, book_page_url in enumerate(book_page_urls):

    bsObject = BeautifulSoup(driver.page_source, 'html.parser')

    # Title, isbn extraction
    title = bsObject.find('meta', {'property':'og:title'}).get('content')
    isbn = bsObject.select_one('#container > > div.book_info > div.book_info_inner > div:nth-child(3)').text

    # index, title, isbn output
    print(index+1, title, isbn)

    kyobo_page_urls = []
    for index in range(0, 1) :
        kyobo_review_data = bsObject.find_all('div', {'class':"npay_wrap"})[1]
        kyobo_review_link ='a')[0].get('href')


    # The part of the problem that doesn't go around
    for index, kyobo_page_url in enumerate(kyobo_page_urls):

        bsObject = BeautifulSoup(driver.page_source, 'html.parser')

        a ='div.comment_wrap')

        for asd in a : 
            kyobo_review = asd.select_one('dd.comment > div.txt').text


python crawling

2022-09-20 08:58

1 Answers

#from import By
#a ='div.comment_wrap')
#a = driver.find_element(By.CSS_SELECTOR, 'div.nav_page > ul.tab_detail_content > li:nth-of-type(3)')
driver.get(kyobo_page_url + '#review')
a ='dd.comment > div.txt')
for asd in a : 
    #kyobo_review = asd.select_one('dd.comment > div.txt').text
    kyobo_review = asd.text
    print(f'kyobo_review = {kyobo_review}')

2022-09-20 08:58

If you have any answers or tips

© 2022 pinfo. All rights reserved.