think Ammar ,one problem vanish,another occur.
here is the content of /home/pt/mytest:

<table>
<tr bgcolor="F3F3F3">
<td align="right" width="240">reportdate</td>
  <td align="right" width="65" class="tickerSm">10/31/09</td>
  <td align="right" width="65" class="tickerSm">10/31/08</td>
  <td align="right" width="65" class="tickerSm">10/31/07</td>
  <td align="right" width="65" class="tickerSm">10/31/06</td>
  <td align="right" width="65" class="tickerSm">10/31/05</td>
  </tr>
<tr bgcolor="ffffff">
<td class="tickerSm">Cash &amp; Equivalents</td>
  <td align="right" class="ticker">2,493</td>
  <td align="right" class="ticker">1,429</td>
  <td align="right" class="ticker">1,826</td>
  <td align="right" class="ticker">2,262</td>
  <td align="right" class="ticker">2,251</td>
  </tr>
<tr bgcolor="ffffff">
<td class="ticker">Receivables</td>
  <td align="right" class="ticker">595</td>
  <td align="right" class="ticker">770</td>
  <td align="right" class="ticker">735</td>
  <td align="right" class="ticker">692</td>
  <td align="right" class="ticker">753</td>
  </tr>
<tr bgcolor="ffffff">
<td class="ticker">Notes Receivable</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  </tr>
<tr bgcolor="ffffff">
<td class="ticker">Inventories</td>
  <td align="right" class="ticker">552</td>
  <td align="right" class="ticker">646</td>
  <td align="right" class="ticker">643</td>
  <td align="right" class="ticker">627</td>
  <td align="right" class="ticker">722</td>
  </tr>
<table>

what i want to get is :
<tr bgcolor="ffffff">
<td class="ticker">Receivables</td>
  <td align="right" class="ticker">595</td>
  <td align="right" class="ticker">770</td>
  <td align="right" class="ticker">735</td>
  <td align="right" class="ticker">692</td>
  <td align="right" class="ticker">753</td>
  </tr>
<tr bgcolor="ffffff">
<td class="ticker">Notes Receivable</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  <td align="right" class="ticker">0</td>
  </tr>
<tr bgcolor="ffffff">
<td class="ticker">Inventories</td>
  <td align="right" class="ticker">552</td>
  <td align="right" class="ticker">646</td>
  <td align="right" class="ticker">643</td>
  <td align="right" class="ticker">627</td>
  <td align="right" class="ticker">722</td>
  </tr>

  p1:
  require 'rubygems'
  require 'nokogiri'
  doc = Nokogiri::HTML.parse(open('/home/pt/mytest'))
  result=doc.xpath('//table/tr[td[@class="ticker"]]')
  puts result

  i can get what i want with p1

  p2:
  require 'rubygems'
  require 'nokogiri'
  doc = Nokogiri::HTML.parse(open('/home/pt/mytest'))
  result=doc.xpath('//table/tr[td[not(@class="tickerSm")]]')
  puts result

  why can't i get what i want with p2??
  how to fix p2?
  think for your help.

-- 
Posted via http://www.ruby-forum.com/.