Urgent problem PCRE or DOM help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<td class="text11">
<a href="some url"><img ></a><br><hr>
 <a href="some url">Home</a> | <b>My Interface</b><br> <br>

<h1 style="color:303030;">My Interface</h1><br>

<table>DONT READ TABLE</table><br>

<b><u>Step-By-Step Instructions:</u></b><br><br>

P tags
IMG tags

<table><tr><td><table>DONT READ</table></td></tr></table><hr>
 </td>

I am having trouble with the above HTML semantics. I just need to read the
content inside the TD with Class name text11(its the only class in the page
as well).
Need to omit the table inside as it contains Adsense ads.

Got to omit the first two A HREF tags as well. I'm not very good with PCRE
so failing to make it work.

Tried with DOMDocument but with the examples found I failed to achieve the
result.

$elements = $doc->getElementsById('table');

if (!is_null($elements)) {
  foreach ($elements as $element) {
    echo "<br/>". $element->nodeName. ": ";

    $nodes = $element->childNodes;
    foreach ($nodes as $node) {
      echo $node->nodeValue. "<br/>";
    }
  }
}

This above code only gets Texts inside but not Img.
Plz any help would be greatly appreciated.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux