use Simple_html_dom php library with codeigniter
Filed Under (php) by admin on 22-01-2010
Tagged Under : php

I was able to figure out how to run Simple_html_dom php library on codeigniter
Download the simple html dom library here simple html dom
I copied the file Simple_html_dom.php to
/system/libraries
Then in my controller I call it using
require_once(‘Simple_html_dom.php’);
To use it, I initialized it using this line
$html = new Simple_html_dom();
Load a page or link using the line
$html->load_file(‘http://www.google.com’);
and parse or find elements using this line
$html->find(‘table tr td’)->plaintext;
works fine and fits right to what I needed to do.


