Skip to content

Instantly share code, notes, and snippets.

@gschorkopf
Created March 2, 2016 03:31
Show Gist options
  • Save gschorkopf/ea3f722d4acc3976519b to your computer and use it in GitHub Desktop.
Save gschorkopf/ea3f722d4acc3976519b to your computer and use it in GitHub Desktop.
$ 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