greenheart Posted October 5, 2009 Share Posted October 5, 2009 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 More sharing options...
czzplnm Posted October 5, 2009 Share Posted October 5, 2009 If dont similar code except with fopen("URL", "R") then find your data with preg_match? Link to comment https://forums.phpfreaks.com/topic/176621-help-with-simple_html_dom/#findComment-931152 Share on other sites More sharing options...
greenheart Posted October 6, 2009 Author Share Posted October 6, 2009 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... Link to comment https://forums.phpfreaks.com/topic/176621-help-with-simple_html_dom/#findComment-931160 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.