Skip to content

Instantly share code, notes, and snippets.

@SoldierCoder
Created April 9, 2013 04:12
Show Gist options
  • Save SoldierCoder/5342893 to your computer and use it in GitHub Desktop.
Save SoldierCoder/5342893 to your computer and use it in GitHub Desktop.
My first attempt at trying to get the links from groups page.
require 'rubygems'
require 'mechanize'
require 'pry'
agent = Mechanize.new
page = agent.get('http://www.facebook.com/ed.drain')
page = agent.page.link_with(:href => 'https://www.facebook.com/bookmarks/groups#').click
agent.page.link_with(:href => 'https://www.facebook.com/bookmarks/groups')
page.links.each do |link|
puts link.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment