正如标题所示,我试图通过id counterResult获取代码它是一个外部网站,这是我的代码到目前为止:
$doc = new DOMDocument();
$doc->loadHTML($url);
$doc->preserveWhiteSpace = false;
$resultCounter = $doc->getElementById('resultCounter');
echo $resultCounter->nodeValue;
我在最后一行(使用echo)得到的错误是)注意:尝试在第10行的C:\ wamp \ www \ wheelofporn \ test.php中获取非对象的属性