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

hpricot:An Hpricot Showcase:Hpricot Challenge:Getting the contents of a tag attribute?

まんま >> 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').first[:href] => "http://www.…