【发布时间】:2014-05-24 14:43:25
【问题描述】:
我的新 codeigniter 应用程序中有以下控制器,它从网页中抓取数据。
但是当我运行脚本时,我在 PHP.Trying to get property of non-object echo $td->nodeValue; 处收到以下错误
我在我的代码中找不到任何错误。为什么会发生这种情况? 任何解决方案。 我附上代码here
【问题讨论】:
-
nodeValue是您的 td 节点的属性吗? -
您只能调用
simple_html_dom对象的方法和属性...您可能正在寻找$td->plaintext或$td->innertext...查看the doc了解更多详细信息... -
那不是简单的html dom,那是DomDocument。简单不使用
nodeValue。 -
@Enissay:我尝试了纯文本和内部文本,但显示相同的问题。我认为 td 不是对象..为什么会这样?
标签: php codeigniter parsing simple-html-dom