Skip to content

Instantly share code, notes, and snippets.

@takano32
Created November 17, 2009 07:35
Show Gist options
  • Select an option

  • Save takano32/236751 to your computer and use it in GitHub Desktop.

Select an option

Save takano32/236751 to your computer and use it in GitHub Desktop.
# !/usr/bin/env ruby1.8
require 'rubygems'
require 'mechanize'
require 'scrapi'
def mechanize_doc
agent = WWW::Mechanize.new
response = agent.get('http://twitter.com/takano32/hametsu/members')
return response
end
scraper = Scraper.define do
process "span.screenname > a", "names[]" => :text
result :names
end
names = (scraper.scrape(mechanize_doc.body,
:parser_options => {:char_encoding => 'utf8'}))
puts names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment