Scraping Forbes and RateMyProfessors to Create a College Recommendation App

Scraping Forbes and RateMyProfessors to Create a College Recommendation App

Posted by Will Markowitz

Updated: Oct 17, 2017


College Recommendation App

I created a web application using data collected from Forbes and RateMyProfessors as a tool for prospective college students and their families. The application conveniently synthesizes general statistics with student sentiment at elite American colleges and universities.

The user is able to input their SAT score, budget, desired student body size and/or preferred state in order to find schools that would be an appropriate match. From those schools, the user can select two and see how the RateMyProfessors ratings are trending over time in any given rating category as well as a side-by-side comparison of the schools with statistics from Forbes and average ratings from RateMyProfessors.

The application was created using R Shiny and is available here.



Scraping Procedure

  1. Forbes is scraped, generating a list of the top 100 colleges and additional information such as location, SAT range and costs associated with attending the school.
  2. The names of the schools are then queried into the RateMyProfessors school search. The correct search result is identified and the URL is saved.
  3. Finally, each RateMyProfessors URL is visited, and every review on the page is collected. A review consists of ratings on categories (e.g., happiness, food, internet, opportunities) on a scale from one to five.


Scraping Software

The data was scraped using the Selenium and Beautiful Soup Python packages.

When a school's review page is visited on RateMyProfessors, 20 reviews at most are visible in the browser or the HTML code. To load 20 more reviews, the user must click the “Load More” button located at the bottom of the page. In order to load all the reviews, the user must repeat this process until the “Load More” button disappears.

While Selenium in general is a slower scraping method, it is necessary in this case.  The Selenium WebDriver Object interacts with the webpage by locating the “Load More” button and continuing to click that button until all school reviews are visible in the HTML code.

Once fully loaded, the entire HTML code is saved as an Object which Beautiful Soup can then parse. It is possible to do this parsing in Selenium, but Beautiful Soup is much faster.


Scraping Techniques

Two techniques were integral in the scraping of RateMyProfessors and can be useful in scraping numerous other websites. I have described them below. 


RateMyProfessors has numerous advertisements that significantly increase the page load time and in some instances inhibit the browser’s ability to scroll on the page without exiting out of the ads. Even if you have an adblocker installed on your normal browser, the automated Selenium browser will not have it installed automatically. The following code snippet adds AdBlockPlus to an automated Chrome browser.

Scrolling and Clicking

The Selenium click command does not execute unless the load button is scrolled into the browser’s current view. The normal Selenium commands for scrolling an element into view were not responding; however, Selenium commands did yield the correct location of the button. I used the following code to execute the JavaScript command that loads the desired location into view, and subsequently uses Selenium to click the button.





Will Markowitz

View all articles

Topics from this blog: statistics R NYC Web Scraping data Student Works Selenium Shiny R Shiny beautiful soup

Interested in becoming a Data Scientist?

Get Customized Course Recommendations In Under a Minute