there is an html file
<table>
<tr>
<td>ok
<strong>Sep 10</strong>
<a href="ttt">Oct 10</a>
<a href="kkk">Dec 10</a>
<table>
<tr>
<td>
123
</td>
<td>
567
</td>
</tr>
</table>
</td>
</tr>
</table>
when i open it with firefox,the output is :
ok Sep 10 | Oct 10 | Dec 10
123 567
what i want to get is
ok Sep 10 | Oct 10 | Dec 10
here is my codes
require 'rubygems'
require 'nokogiri'
web='/home/test'
doc = Nokogiri::HTML.parse(open(web))
data=doc.xpath('/html/body/table/tr/td')
puts data
i get
<td>ok
<strong>Sep 10</strong>
<a href="ttt">Oct 10</a>
<a href="kkk">Dec 10</a>
<table><tr>
<td>
123
</td>
<td>
567
</td>
</tr></table>
</td>
how can i get :
ok
<strong>Sep 10</strong>
there is an html file
<table>
<tr>
<td>ok
<strong>Sep 10</strong>
><a href="ttt">Oct 10</a>
><a href="kkk">Dec 10</a>
<table>
<tr>
<td>
123
</td>
<td>
567
</td>
</tr>
</table>
</td>
</tr>
</table>
when i open it with firefox,the output is :
ok Sep 10 | Oct 10 | Dec 10
123 567
what i want to get is
ok Sep 10 | Oct 10 | Dec 10
here is my codes
require 'rubygems'
require 'nokogiri'
web='/home/test'
doc = Nokogiri::HTML.parse(open(web))
data=doc.xpath('/html/body/table/tr/td')
puts data
i get
<td>ok
<strong>Sep 10</strong>
><a href="ttt">Oct 10</a>
><a href="kkk">Dec 10</a>
<table><tr>
<td>
123
</td>
<td>
567
</td>
</tr></table>
</td>
how can i get :
ok
<strong>Sep 10</strong>
><a href="ttt">Oct 10</a>
><a href="kkk">Dec 10</a>