Skip to content

Instantly share code, notes, and snippets.

@eric-wood
Last active August 29, 2015 14:10
Show Gist options
  • Save eric-wood/ce1830a4ea291075e5e2 to your computer and use it in GitHub Desktop.
Save eric-wood/ce1830a4ea291075e5e2 to your computer and use it in GitHub Desktop.
require 'open-uri'
url = "http://google.com" # replace this with your stuff
open(url) do |f|
doc = Nokogiri::HTML(f.read)
# replace "n" with the element number you want
doc.css('b')[n].content
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment