Skip to content

Instantly share code, notes, and snippets.

@rakuishi
Created April 8, 2016 10:05
Show Gist options
  • Save rakuishi/d6e10c6fee1dbe1d59b9830f11dcdfaf to your computer and use it in GitHub Desktop.
Save rakuishi/d6e10c6fee1dbe1d59b9830f11dcdfaf to your computer and use it in GitHub Desktop.
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://www.onsen.ag'))
doc.xpath('//section[@id="movieList"]//div[@class="listWrap"]//ul[@class="clr"]//li').each do |node|
p node.xpath('h4[@class="listItem"]').inner_text
p node.xpath('p[@class="thumbnail listItem"]//img').attribute('src').text
break
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment