I am trying to scrape reviews from this website: https://www.goodreads.com/book/show/4865.How_to_Win_Friends_and_Influence_People?from_search=true&from_srp=true&qid=zsfs3jEPvd&rank=1
Reviews are hidden down many nested classes, I am trying to reach them but facing issues. I am fairly new to selenium. So far, I tried:
'''
a = driver.find_element("class name", "BookPage__reviewsSection")
for i in a.find_element("xpath", "//* [@id='ReviewsSection']").find_elements("class name",'lazyload-wrapper '):
print(i.find_element("xpath","//div[@class='ReviewsList']").text)
'''
The print statement outputs:
Friends & Following
Create a free account to discover what your friends think of this book!
Friends & Following
Create a free account to discover what your friends think of this book!
According to the output it just finds 'BookPage__reviewsSection' class and then 'ReviewsList' class which explains the output. Why doesn't it find 'lazyload-wrapper' class and then 'ReviewsList' class inside it?
I appreciate the help.