meister14 Posted March 26, 2010 Share Posted March 26, 2010 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 />'; Link to comment https://forums.phpfreaks.com/topic/196561-converting-parsed-out-html-into-array/ Share on other sites More sharing options...
meister14 Posted March 27, 2010 Author Share Posted March 27, 2010 Anybody have an idea of what I should do? Link to comment https://forums.phpfreaks.com/topic/196561-converting-parsed-out-html-into-array/#findComment-1032588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.