From: Pen Ttt Date: 2010-08-29T11:37:21+09:00 Subject: Re: select tr>3 with nokogiri i found some secret,if my file /home/pt/mytest was changed into:
reportdate 10/31/09 10/31/08 10/31/07 10/31/06 10/31/05
Cash & Equivalents 2,493 1,429 1,826 2,262 2,251
Receivables 595 770 735 692 753
Notes Receivable 0 0 0 0 0
Inventories 552 646 643 627 722
with the code , require 'rubygems' require 'nokogiri' doc = Nokogiri::HTML.parse(open('/home/pt/mytest')) result=doc.xpath('//table/tr[*[not(@class="tickerSm")]]') puts result what i can get is: the row can not be selected by my code, but how to delete row with xpath? it can't work : xpath('//table/tr[*[not(@class="tickerSm")]]') maybe the reason is : some class of td is "ticker",another is "tickerSm", if i don't want to select it with xpath,how to express it with xpath?? -- Posted via http://www.ruby-forum.com/.
Cash & Equivalents 2,493 1,429 1,826 2,262 2,251
Receivables 595 770 735 692 753
Notes Receivable 0 0 0 0 0
Inventories 552 646 643 627 722
reportdate 10/31/09 10/31/08 10/31/07 10/31/06 10/31/05
Cash & Equivalents 2,493 1,429 1,826 2,262 2,251