DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for It's Scraping Seasons
JaredHarbison
JaredHarbison

Posted on • Updated 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!

We want your help! Become a Tag Moderator.
Fill out this survey and help us moderate our community by becoming a tag moderator here at DEV.