-1

I am trying to scrape user reviews off an IMDB page.

Specifically this one: https://www.imdb.com/title/tt0993846/reviews?ref_=tt_ql_3

Reviews = driver.find_elements_by_class_name('content')
Print(Reviews[0].text)

The code above gets me the first review just fine.

However, the 5th review titled "Good or Bad depending on what you want..." is a spoiler review and this method does not seem to grab the text.

I have tried using:

driver.find_elements_by_class_name('text show-more__control clickable')

But this doesn't seem to do the trick

jun
  • 540
  • 5
  • 17
  • Possible duplicate of [Selenium Compound class names not permitted](https://stackoverflow.com/questions/37771604/selenium-compound-class-names-not-permitted) – JeffC Sep 10 '19 at 19:49
  • BEFORE you ask a question, you should start by googling the error message and working through the questions and answers and try the various solutions. Then if you still can't find a solution, you should ask your question and make sure to add the full error message to the question. – JeffC Sep 10 '19 at 19:51

1 Answers1

1

Try the following css selector hopefully this will return all reviews on the page.

for item in driver.find_elements_by_css_selector(".review-container"):
    print(item.text)
KunduK
  • 32,888
  • 5
  • 17
  • 41
  • This only grabs the title for the spoiler review. It doesn't seem to get the review itself. I think it might not have loaded until you click "show review". I might have to have the program click it. – jun Sep 11 '19 at 00:29