Hpricot

tableのtdタグだけ抽出

require 'hpricot' doc = Hpricot( open('http://url').read ) #mc_listという名前のtableのtdタグだけ抽出 table = (doc/"table.mc_list td") table.each{|tag| #htmlタグを出力 puts.inner_html #テキストを出力 puts.inner_text }ネタ元 http://route477.…