i like to parse a website. The Content i need is between <td class="txt" height="1"> and <br>
Code: Select all
<td class="txt" height="1">
TEXT
TEXT
TEXT
TEXT
TEXT
TEXT
<br>
greets Koepi
Code: Select all
<td class="txt" height="1">
TEXT
TEXT
TEXT
TEXT
TEXT
TEXT
<br>
Code: Select all
regexp {<td.*?>(.*?)<br>} $string -> text
Code: Select all
tag when posting logs, code
Code: Select all
<table border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
<td class="head" colspan="2">TITLE1</td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="1"></td>
<td class="head" colspan="2">DATE</td>
</tr>
<tr>
<td colspan="3"><img src="woche_dateien/p_0.gif" alt="" border="0" height="24" width="1"></td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="1"></td>
<td class="head" colspan="2">TITLE2</td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
<td class="fliesstxt" height="1">
TEXT
TEXT
TEXT
TEXT
TEXT
<br>
</td><td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
</tr>
<tr>
<td colspan="3"><img src="woche_dateien/p_0.gif" alt="" border="0" height="24" width="1"></td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="1"></td>
<td class="head" colspan="2">TITLE3</td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
<td class="fliesstxt" height="1">
TEXT
TEXT
TEXT
TEXT
TEXT<br>
</td><td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
</tr>
<tr>
<td colspan="3"><img src="woche_dateien/p_0.gif" alt="" border="0" height="24" width="1"></td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="1"></td>
<td class="head" colspan="2">TITLE4</td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
<td class="fliesstxt" height="1">
TEXT
TEXT
TEXT
TEXT
TEXT<br>
</td><td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
</tr>
<tr>
<td colspan="3"><img src="woche_dateien/p_0.gif" alt="" border="0" height="24" width="1"></td>
</tr>
<tr>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="4" width="10"></td>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="580"></td>
<td><img src="woche_dateien/p_0.gif" alt="" border="0" height="1" width="10"></td>
</tr>
</tbody></table>
Code: Select all
set data [http::geturl $url]
set data2 [http::data $data]
http::cleanup $data
foreach line [split $data2 \n] {
if {[regexp -nocase {<td class="head" colspan="2">(.*?)</td>} $line a ]} {
puthelp "PRIVMSG $chan :$a"
Code: Select all
regexp {<td.*?>(.*?)<br>} $string -> text
Code: Select all
tag when posting logs, code