Created
March 2, 2016 03:31
-
-
Save gschorkopf/ea3f722d4acc3976519b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
# Into the console! | |
> require 'open-uri'; require 'nokogiri' # requiring the libraries you need. you might need to 'gem install nokogiri' for this to work | |
=> true # it's been required! | |
> doc = Nokogiri::HTML(open('https://bluebottlecoffee.com/store/bella-donovan')) # opening the Blue Bottle website in nokogiri, turning it into Ruby | |
=> #<Nokogiri::HTML::Document:0x3fc5d1cd4bd8 name="document" ... etc. | |
> doc.css('.mb30').children.text # let's find the CSS for coffee notes, and find the text | |
=> "Heavy, comforting, deeply-fruited " # here it is! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment