Scraping and Exploring IMDB

Posted on Sep 17, 2019


IMDB is one of the most widely used websites for people deciding whether or not a movie is worth watching. Users can not only access movie ratings, but they can read different reviews on the movie to see why or why not it was well received. Having access to movie reviews in addition to ratings allows potential viewers a certain level of autonomy in deciding whether a movie would be "good" or "bad" to watch.

Research Questions

I wanted to find a polarizing movie with good and bad reviews and ratings, so I scraped for reviews and ratings on the first Purge movie. I used the Purge because it's such a polarizing

With this project, I set out to answer the following questions:

  1. IMDB users have the ability to critique reviews based on how helpful they are. Is there a common theme among reviews? Do higher ratings typically have a higher helpfulness score?
  2. Is there a recurring word or phrase in good reviews? bad reviews?

Web Scraping

I scraped the IMDB website for the movie, Purge, using Selenium. Selenium seemed like the optimal choice because IMDB is a dynamic website with people constantly posting new reviews and ratings. Below are the fields that I thought could be interesting to analyze and chose to scrape.

  1. Title of the movie
  2. Username of person giving the review
  3. Date of the review
  4. Review content
  5. Rating given by the reviewer
  6. Average score given to the review

Data Preparation

The data scraped from IMDB is well formatted and so strenuous data cleaning was not necessary. Most of the data preparation was done on the review content feature. In order to maximize the information gained from the review content, the characters in the review were first changed to lower case (for uniformity), all characters that are not in the alphabet and stopwords (words that do not provide useful information) were removed, and the combined string was split into a list of words.

Analysis and Conclusion

I first did some initial data exploration to gain insight into the data. First, I wanted to see the distribution of ratings for the movie and how the ratings for the movie have changed over time. This is shown in figures 1 and 2 below.

                                          Figure 1

                                     Figure 2


Although an overwhelming majority gave the Purge a very low rating, there is still a high variance in the ratings, so I decided to do some analysis on that. There doesn't seem to be a visible trend in ratings over the years shown above, but the rating seemed to be highest when it came out in 2013. For the main part of my analysis, I wanted to see if there were any frequently occurring words that distinguished good reviews from bad reviews. In order to do that, I split the data into reviews for ratings less than 5 (bad reviews) and reviews for ratings greater than or equal to 5 (good reviews).

                                   Figure 3 (Good Reviews)

                                 Figure 4 (Bad Reviews)


The words that show in bigger print on the word cloud represent the words that most commonly occur. Some common words in the good reviews are enjoyed, decent, and far fetched. Common words in the bad reviews are waste, plot hole, and wasted potential. It's interesting to see the commonalities in the different kinds of reviews. For future research, I would like to expand this project to multiple movies and see if common words show up in reviews among different genres. I also think it would be cool to utilize machine learning to predict movie ratings based on the different words that show up in reviews.


About Author

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp