PHP Simple HTML DOM Parser
致命错误:在第14行的/home/admin/web//public_html/index.php中调用boolean上的成员函数find()
为什么会失败?
include("simple_html_dom.php");
$html = file_get_html('http://en.wikipedia.org/wiki/facebook');
$title = $html->find('h1[id=firstHeading]',0)->innertext;
echo $title;
答案 0 :(得分:0)
我不熟悉file_get_html但它可能在错误时返回false,所以你应该检查返回的值:
if ($html === false) {
// check what the error is (look for file_get_html documentation to understand how to get more info on the error
} else {
// file is ok, process it
}