пытается найти способ извлечь краткое содержание книги со страницы хорошо прочитанных. Пробовали Beautiful soup / Selenium, к сожалению, безрезультатно.
ссылка: https://www.goodreads.com/book/show/67896.Tao_Te_Ching?from_search=true&from_srp=true&qid=D19iQu7KWI&rank=1
код:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup
import requests
link='https://www.goodreads.com/book/show/67896.Tao_Te_Ching?from_search=true&from_srp=true&qid=D19iQu7KWI&rank=1'
driver.get(link)
Description=driver.find_element_by_xpath("//div[contains(text(),'TextContainer')]")
#first TextContainer contains the sumary of the book
book_page = requests.get(link)
soup = BeautifulSoup(book_page.text, "html.parser")
print(soup)
Container = soup.find('class', class_='leftContainer')
print(Container)
Ошибка:
контейнер пуст +
NoSuchElementException: нет такого элемента: невозможно найти элемент: {"метод": "xpath", "селектор": "// div [содержит (text (), 'TextContainer') ] "} (Информация о сеансе: chrome = 83.0.4103.116)