Php 提取数据失败,出现错误“;对非对象调用成员函数find();
为什么这个代码不起作用?我仍然收到此错误: 对中的非对象调用成员函数find()Php 提取数据失败,出现错误“;对非对象调用成员函数find();,php,parsing,Php,Parsing,为什么这个代码不起作用?我仍然收到此错误: 对中的非对象调用成员函数find() 尝试使用var_dump查看函数调用的结果 很可能php.ini配置禁止您获取外部数据。有关此操作的详细信息,请查看phpinfo()。要查看的属性是'allow\u url\u fopen'file\u get\u html()失败。你需要弄清楚原因。 <?php header('Content-type: text/plain; charset=utf-8'); include('simple_html
尝试使用var_dump查看函数调用的结果 很可能php.ini配置禁止您获取外部数据。有关此操作的详细信息,请查看phpinfo()。要查看的属性是'allow\u url\u fopen'
file\u get\u html()
失败。你需要弄清楚原因。
<?php
header('Content-type: text/plain; charset=utf-8');
include('simple_html_dom.php');
$html = file_get_html('http://www.test.com/');
// Find all links
foreach($html->find('a') as $element) {
echo $element->href . '<br>';
}
?>