您好,我试图从网站上提取一些信息以将其放入表格中,然后在 php 中打印
我正在使用 DOM 解析器,因为它看起来正是我需要的
<?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);
?>
我不断得到
Fatal error: Call to a member function find() on a non-object
在
foreach($table->find('tr') as $row) {