簡単なタグの抜き方
1 require 'rubygems' 2 require 'scrapi' 3 require 'pp' 4 5 html = open("index.html","r").read 6 7 ret = Scraper.define do 8 process 'p' , "items[]" => :text 9 result :items 10 #end.scrape( URI.parse(url) ) 11 end.scrape( html ) 12 13 pp ret 14 15
index.html
<body> <p>hoge</p> <p>hoge2</p> <p>hoge3</p> </body>