2010-03-06から1日間の記事一覧

hpricot:An Hpricot Showcase:Hpricot Challenge:Getting the contents of tag multiple attributes?

まんま >> require "hpricot" => true >> doc = Hpricot('<a href="http://www.foo1.org/">foo1</a><a href="http://www.foo2.org/">foo2</a>') => #<Hpricot::Doc {elem <a href="http://www.foo1.org/"> "foo1" </a>} {elem <a href="http://www.foo2.org/"> "foo2" </a>}> >> doc.search('a[@href]').map {|x| x['href']} =…