Welcome Guest, Not a member yet? Register   Sign In
[Solved] Getting simple_html_dom to work with CI?
#2

[eluser]davidbehler[/eluser]
As there is no simple_html_dom class in the downloaded file you would rather have to use it as a helper than as a library.
Drop the simple_html_dom.php file in your helper folder and then do it like this:
Code:
$this->load->helper('simple_html_dom');
// Create DOM from URL or file
$html = file_get_html($next_page);

// Find all images
foreach($html->find('img') as $element)
       echo $element->src . '<br>';

// Find all links
foreach($html->find('a') as $element)
       echo $element->href . '<br>';
Maybe that works


Messages In This Thread
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 02:02 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 03:23 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 03:35 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-11-2009, 05:50 PM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 01:38 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 07:15 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-12-2009, 07:21 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 05-31-2009, 04:18 AM
[Solved] Getting simple_html_dom to work with CI? - by El Forum - 06-04-2009, 10:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB