From: Ammar Ali Date: 2010-08-28T22:02:22+09:00 Subject: Re: select tr>3 with nokogiri If the table is not the root or directly inside the root, you need 2 "/" in the beginning. The count function applies to the tr, not the td, so you don't need the "*" in p1, or the td in p2. Try this: doc.xpath('//table/tr[count(td)>1]') Good Luck, Ammar On Sat, Aug 28, 2010 at 3:33 PM, Pen Ttt wrote: > document.xpath("//*[count(td)=2]")  is  right,but  i want to know > p1 >  data=doc.xpath('/table/tr/*[count(td)>1]') >  puts data > p2 >  data=doc.xpath('/table/tr/td[count(td)>1]') >  puts data > how to  fix p1\p2? > -- > Posted via http://www.ruby-forum.com/. > >