DEV Community

Cover image for It's Scraping Seasons
JaredHarbison
JaredHarbison

Posted on • Edited on

It's Scraping Seasons

Rails + React + Redux - Pt 3


This post is going to focus on some of the more challenging tasks I encountered while scraping data from Fandom and connecting the data appropriately into the schema established in the last post. This post will focus on defining the get_seasons method and the get_queens method will follow. The gists are heavily commented!


Let's get started!


1. Def get_seasons in season.rb to scrape the list of season names from Fandom, concatenate each season name into an array of URLS for each Season's Wikipedia page, then iterate through the array to .create!() an instance of each Season.

2. Def get_queens in queen.rb to scrape the list of queens' names from Fandom, concatenate each queen's name into an array of URLs for each Queen's Fandom page, then iterate through the array to .create!() an instance of each Queen and her attributes (including associations for Quotes and Trivia.

__see the following post for the gist__

3. With Seasons and Queens instantiated, iterate through the Seasons and .create!() an appearance for each episode per Queen and her appropriate appearance attributes.

__see following posts for the gist__

That's all folks!

Top comments (2)

Collapse
 
bengreenberg profile image
Ben Greenberg

Great final project! Love seeing fellow Flatiron grads projects, well done!

Collapse
 
jaredharbison profile image
JaredHarbison

Thanks Ben!