Skip to content

Instantly share code, notes, and snippets.

@JerrySeto
Created May 21, 2015 16:23
Show Gist options
  • Select an option

  • Save JerrySeto/725dc136d49233c053f2 to your computer and use it in GitHub Desktop.

Select an option

Save JerrySeto/725dc136d49233c053f2 to your computer and use it in GitHub Desktop.
require 'mechanize'
agent = Mechanize.new
agent.get('http://www.producthunt.com/tech?page=1') do |page|
content = page.search('.post--content')
title = content.map do |post|
title = post.search('a.title').text
description = post.search('.description').text
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment