require 'ruby-cheerio'
jQuery = RubyCheerio.new("<html><body><h1 class='one'>h1_1</h1><h1>h1_2</h1></body></html>")
jQuery.find('h1').each do |head_one|
p head_one.text
end
# getting attribute values like jQuery.
p jQuery.find('h1.one')[0].prop('h1','class')
# function chaining similar to jQuery.
p jQuery.find('body').find('h1').first.text