i'm using a parsing library called 'simplehtmldom'. all i want to do is extract the textual contents of table cells. that's all! it seems so simple... everything i've tried results in the ENTIRE FRIGIN PAGE being dumped because apparently all of the primitives traverse the dom tree up, down, and sideways. here's a trivialised example of what i'm trying to do :
$saved = '';
foreach($html->find('tr') as $tr) {
foreach($tr->find('td') as $td) {
$contents = $td->plaintext;
if ($saved) {
echo "$saved : $contents<br>\n";
$saved = '';
}
if (strstr($contents, 'Title') || strstr($contents, 'Author')) {
$saved = $contents;
}
}
}
i've tried using 'plaintext', 'innertext', and 'text', but no matter what i try, i end up getting either endless loads of crap echoed out, or else nothing at all.
does anyone know how to use this parser ? or else could suggest an alternative to do what i want to do ?