[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: select tr>3  with nokogiri
From:       Ken Bloom <kbloom () gmail ! com>
Date:       2010-08-29 2:08:14
Message-ID: pan.2010.08.27.22.50.24 () gmail ! com
[Download RAW message or body]

On Fri, 27 Aug 2010 23:26:53 +0900, Pen Ttt wrote:

> i want to get  row which it contains  more than 3  columns how to write
> xpath  with  nokogiri
> 
> 
>   require 'rubygems'
>   require 'nokogiri'
>   item='sometext'
>   doc = Nokogiri::HTML.parse(open(item))
>   data=doc.xpath('/html/body/table/tr[@td.size>3]') puts data
>   it can not run , help and advices appreciated.

doc.xpath('/html/body/table/tr[count(td)>3]')



-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic