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

hpricot:Hpricot::Traverse#previous, #previous_node

>> require "hpricot" => true >> doc = Hpricot('<p>foo1</p><p>foo2</p><p>foo3</p><p>foo4</p>') => #<Hpricot::Doc {elem <p> "foo1" </p>} {elem <p> "foo2" </p>} {elem <p> "foo3" </p>} {elem <p> "foo4" </p>}> >> doc.at('p').previous => nil >> doc.search('p')[1].previous => {elem <p> "foo1" </p>} >> doc.…