Skip to content

Instantly share code, notes, and snippets.

@nagaki
Created November 9, 2014 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nagaki/8ffd8cb3bd30416972ea to your computer and use it in GitHub Desktop.
Save nagaki/8ffd8cb3bd30416972ea to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open('http://www.heartrails.com'))
doc.search('//td[@class="services_table"]').each do |s|
p '------------------------------'
p s.search('p').text
p s.search('a')[0].attributes["href"].value
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment