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

hpricot:An Hpricot Showcase:Hpricot Challenge:Preceding / Following Children?

まんま require "hpricot" X =<<EOS <div> <A>...</A> ... <B>...</B> <a name='articlestart'> </a> <C>...</C> ... <D>...</D> </div> EOS doc = Hpricot(X) p doc.at('//a[@name="articlestart"]') p doc.at('//a[@name="articlestart"]').following_siblings で、 {elem <a name="articlestart"> " " </a>} #