learn-co-curriculum / scraping-flatiron-code-along Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
A student couldn't proceed with the lab because she was running into the above error. Uninstalling and re-installing nokogiri (various versions between 1.6-1.8) proved unsuccessful. I made sure that we removed the lab and re-cloned it to start fresh, but the issue persisted.
Creating this issue in case another Windows user with the new IDE has the same problem. See screenshot below for details.
Course
instance methods
#title
has a setter and a getter method for title
#schedule
has a setter and a getter method for a course's schedule
#description
has a setter and a getter method for a course's description
class methods
.all
returns and array of all the instances of the Course class (FAILED - 1)
learn text refers to a "magnifying glass symbol" under the dev tools in google chrome, which is now a symbol of a mouse cursor in a box (page also refers to "inspect element" which is now "inspect" in current version of Google Chrome). easily google-able for students who get confused, but thought i'd point it out in case revisions are underway :)
Hello, I was trying to follow along with this lesson but was having issues producing the same Nokogiri output on my end. Gabe Jackson helped me figure out that I needed to chain a ".inspect" method on the end of the code in my editor in order for it to work. So for example the below code should have ".inspect" at the end for me to have the same output that the lesson is saying I should be seeing.
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open("http://flatironschool.com/"))
doc.css(".grey-text")
puts doc.css(".grey-text")
Currently reads:
Go back to the site and open up the element inspector again. Use the magnifying class symbol...
Should read:
Go back to the site and open up the element inspector again. Use the magnifying c=glass symbol...
I was coding along with the instructions in the lesson, I got all tests passing without writing #make_courses methods.
For each iteration over the collection of Nokogiri XML elements returned to use [should be "us"] by the doc.css(".post") line, we are making a new instance of the Course class and giving that instance the title, schedule and description extracted from the XML.
The curriculum mentions that a #print_courses method was provided as a 'freebie' for this lab in the scraper.rb file. However, this is no #print_courses method already predefined in the scraper.rb file. Near the end of the lab, the curriculum asks students to run Scraper.new.print_courses but again, there is no method defined for #print_courses until you scroll to the bottom of the curriculum, where a screenshot shows the #print_courses method as:
def print_courses
self.make_courses
Course.all.each do |course|
if course.title
puts "Title: #{course.title}"
puts " Schedule: #{course.schedule}"
puts " Description: #{course.description}"
end
end
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.