Created
November 17, 2009 07:35
-
-
Save takano32/236751 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # !/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