I have been working with simple_html_parser trying to parse out the financial tables from yahoo. I have made pretty good progress (it doesn't look like much, but it took me awhile) and I have been able to seperate it all out.
However, whenever I try to do an "echo $b[1];" I get an error saying "Fatal error: Cannot use object of type simple_html_dom_node as array in C:\wamp\www\test\index3.php on line 28"
What I would like to do is take each element (financial number) and store it in my MySql. I believe I could do that if I were able to seperate out the different numbers, I would then be able to insert them into the database.. Let me know if I could be more clear on what I am trying to do.. Thanks!
(the code below works)
include('simple_html_dom.php');
// get DOM from URL or file
$html = file_get_html('http://finance.yahoo.com/q/is?s=NEM&annual');
// find all table data with class "yfnc_tabledata1"
foreach($html->find('table.yfnc_tabledata1 td') as $e)
foreach($e->find('tr') as $a)
foreach($a->find('td') as $b)
echo $b.'<br />';