Jump to content

help with simple_html_dom


greenheart

Recommended Posts

Hello, I'm trying to use simple html DOM to extract everything inside the tags on a html page with the class "site point". Here is my code that doesn't work:

<?php
include_once('simple_html_dom.php');

$html = file_get_html('examplewebsite');
$ret = $html->find('.site point');
echo $ret->innertext;

?>

 

Below is an example of one of the site point tags (there are ten or so) with the information inside which I want.

<dl class="site point">
<dd class="thumbnail">
<a href="blabla" ></a><a href="/toolbar/sidepanel.php?url=random.html" >Get This      Now</a>   </dd><dt class="notext"><a href="/to/" >Title</a></dt><dd class="starts">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td class="textUncolor"> CUT OUT SOME IMAGES AND       ADDRESSES HERE
                            </td></tr>
</table>
</dd>
</dl>

 

Can anyone help me get it working? Thank you very much.

 

Link to comment
https://forums.phpfreaks.com/topic/176621-help-with-simple_html_dom/
Share on other sites

If dont similar code except with fopen("URL", "R")

then find your data with preg_match?

Thanks for the reply. preg_match is the last resort as I have more complicated examples in mind and it would make my life easier if I could understand why the above example isn't working.

 

I'm completely stumped...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.