From: Sylvain Tenier Date: 2006-12-19T22:30:53+09:00 Subject: Re: find all possible container nodes of a given text your code assumes that the text is contained in a leaf that is child of a td node. What I'm looking for is the direct parent of any leaf containing the string. For instance, in your code, if I replace td by tr I get [{elem {elem {text "harr is a dog"} } {elem {text "fuu is a cat"} } {elem {text "jii is adog"} } }] I don't want tr to be returned, since it is an ascendant, not a direct parent sorry if I wasn't clear enough in my question Sylvain -- Rien ne peut jamais marcher si l'on songe � tout ce qu'il faut pour que �a marche. -- Daniel Pennac Selon Peter Szinek : > >> I would like to set this query > >> > >> getNodesContaining("dog") > > (Hpricot(html)/"//td").map.reject{ |node| node.inner_text !~ /dog/ } > > Cheers, > Peter > > __ > http://www.rubyrailways.com >