Hello im trying to pull some information from a website to put it into a table, then print it in php
i'm using the DOM parser as it looks like its exactly what i need
<?php
include 'simple_html_dom.php';
$html = file_get_html('http://evolve.sg-community.de/index.php?page=plugins');
$table = $html->find('#theTable');
$theData = array();
foreach($table->find('tr') as $row) {
$rowData = array();
foreach($row->find('td.text') as $cell) {
$rowData[] = $cell->innertext;
}
$theData[] = $rowData;
}
print_r($theData);
?>
i keep getting
Fatal error: Call to a member function find() on a non-object
at
foreach($table->find('tr') as $row) {
You could use DOM parser,see http://docs.php.net/manual/en/domdocument.loadhtml.php for more informations.
Are you asking how to 1)grab the websites or 2)how to strip the data.
For 1) Look at: http://php.net/manual/en/book.curl.php
you can use phpQuery to parse that page and get the contents you want