Parsing html specific block
[1/3] from: lp::legoff::free::fr at: 13-Apr-2004 12:06
Hi list,
Maybe a standard question :
How parse a html file containing some <tr>...</tr> blocks like :
....
<table width="600" align="center" border="0" cellpadding="1" cellspacing="1"
><tr>
<td align="center" nowrap><span >TARGET</span></td>
<td align="center" nowrap><span >URL</span></td>
<td align="center" nowrap><span >WORD</span></td>
<td align="center" nowrap><span >TEST</span></td>
<td align="center" nowrap><span >TIME</span></td>
</tr>
<tr>
<td align="left" nowrap><a href="http://wwww.google.com">GOOGLE</a></td>
<td align="center" nowrap>http://wwww.google.com</td>
<td align="center" nowrap>Google</td>
<td align="center" nowrap>KO</td>
<td align="center" nowrap>NA</td>
</tr>
..... etc
</table>
....
BUT just keep <tr>..</tr> blocks containing specific strings like "KO" and
reform the html file with them inside original <table>...</table>.
Any idea ?
Thanks a lot,
Philippe.
[2/3] from: greggirwin:mindspring at: 13-Apr-2004 9:28
Hi Philippe,
llff> How parse a html file containing some <tr>...</tr> blocks like :
....
llff> BUT just keep <tr>..</tr> blocks containing specific strings like "KO" and
llff> reform the html file with them inside original <table>...</table>.
Something like this?
rules: [
any [
copy text thru <tr> (print text)
copy text to </tr> (
if find text "KO" [print text]
)
]
copy text to end (print text)
]
Though this naively assumes that your <tr></tr> sections don't have
anything between them that you want to ignore, so it's not a complete
solution.
-- Gregg
[3/3] from: lp:legoff:free at: 13-Apr-2004 20:38
Hi gregg,
As usual, a nice and obvious answer with Rebol...
A little work again for me to work fine with my problem.
Thanks Gregg.
Philippe.
Selon Gregg Irwin <[greggirwin--mindspring--com]>: