Web Scraping TV Show Sites: Analysis and Exploration

Alex Yuan Li
Posted on Nov 21, 2016

Introduction

Television shows are an important part of everyday life. They can be portals to a parallel universe or windows to our wildest dreams. All these different shows give rise to many different review websites, each with its own scoring system and critic reviews. Out of curiosity, let's compare these review websites to see how different their scores are compared to each other. For this project, three popular TV show websites was chosen for analysis: The Movie Db, Rotten Tomatoes, and IMDb.

Scraping Process

The main tool used in this project is Scrapy. It is a free web crawling framework. The main component of Scrapy is a "spider", which is a web crawler with a series of customizable commands for scraping information from a website. Here is a scraping workflow for this project.

scrap-sites

From TVDb main page, I obtained a list of TV shows, then using it as a library to scrap show information. The information I scraped for each TV show includes show name, genre, network, show status, and show rating for each of the three websites. A total of four spiders were implemented in this project: one spider for TVDb , one spider for Rotten Tomatoes, and two for IMDb. IMDb was more difficult to scrape because of its complex url addresses; (each show is encoded as a number rather than its actual name), thus a spider was used to scrape the url of the show. Through the url, another spider was implemented to scrape the attributes of the show. All the spider codes can be find here.

Exploratory Visualization

density-distributionviolin-distribution

 

The top plot is the overall density distribution of all three website scores. The first important observation we can make is that the overall trend is very similar, all three distributions are skewed to the left, meaning few shows have very low scores. The bottom plot is a violin plot of the three score distributions. Rotten Tomatoes has the highest distribution with a median of 8.4, IMDb is the second highest with a median of 7.5, and followed by TVDb with a median of 6.3. Another interesting observation is that Rotten Tomatoes and TVDb has zero values for TV score, and IMDb does not, this might due to the imputation method used for null values of each website.

To explore deeper into the dataset, I analyzed the following distributions of attributes with potential influence: Status, Network, and Genre.

Status:

status-distribution

There are three factors in the status attribute: Cancelled, Ended, Returning Series. From the bar plot, returning series has the highest score compared to cancelled and ended shows. Intuitive, cancelled and ended shows tend to have lower score which ultimately lead to show termination.

Networks:

network-distribution

Top ten network were selected out of 107 different networks. The HBO network has the highest average rating in all three websites, followed by the BBC network.

Genre:

imdb_genre tmt_genretvdb_genre

Although all score distributions exhibit similar behavior, the top genres are different for each distribution. Rotten Tomatoes ranked Talk, News, and Musical as the top three genres scores. IMDb ranked Adventure, Honor, and Crime as the top three scores. TVDb ranked News, Family, and Adventure as the top three. Also note that TVDb has no information on the Talk genre.

From all the exploratory analysis, we can see there is definitely an underlying differences between these three website scoring systems. How do we validate and quantify this difference? Let's perform some statistical analysis to find out!

Statistical Analysis

To examine the differences, lets focus only on the score data from the three websites. First, let's investigate any hidden linear relationship between these three scores.pairsplot

From the scatter plot matrix, we can see a very weak linear relationship or collinearity between IMDb and Rotten Tomatoes scores, and no other definite linear relationship can be visualized from the scatter plots.

biplot

Another approach to measure collinearity is through the biplot obtained from PCA. The biplot is composed of the top two principal components, which are orthogonal vectors composed of a linear combination of the three score vectors. From the biplot, the IMDb and Rotten Tomatoes vector points in a similar direction, which again shows that they exhibit some collinearity with each other.

Since both the scatter plot matrix and biplot show that there is a linear relationship, albeit a weak one, are these two score distribution statistically similar, or significant different? A two sample, unequal variance, 95% confidence, two-tail t-test will be able to answer this question.

t-test-resThe p-value is significant smaller than threshold value 0.05, therefore although the two scores might have some degree of collinearity, the test shows that they are in fact significantly different.

Finally, an One-Way ANOVA was performed to test if all three scores are different.

anova

An extremely small p-value indicates that we reject the null hypothesis, therefore the three distributions are in fact significantly different from each other.

 

Conclusion

As observed from both the exploratory and statistical analysis, we can definitely state there is a significant difference in the distribution of scores for these three websites. From the visualization, we can conclude that the scores from Rotten Tomatoes tend to give higher scores than the rest. Also, we saw a weak degree of collinearity between IMDb and Rotten Tomatoes distributions. However, after performing statistical testing, the t-test concluded that IMDb and Rotten Tomatoes score distributions are significantly different from each other. One-way ANOVA saw that these three distributions are indeed all significantly different. When we compare ratings from different websites, it is pivotal that we compare TV shows on the same scales.

About Author

Alex Yuan Li

Alex Yuan Li

Alex Li received his Master of Science in Mechanical Engineering at Columbia University and Bachelor of Science in Chemical Engineering at University of Utah with professional experience in Research and Development in the Medical Device industry. He discovered...
View all posts by Alex Yuan Li >

Related Articles

Leave a Comment

Avatar
hermes picotin 31 bags Knockoff June 20, 2017
great man, works well on fedora14 hermes picotin 31 bags Knockoff http://www.accessoires-mode.in/hermes-picotin-24-c18_19/
Avatar
online May 21, 2017
Alo Bali Online Store

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 Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python 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