PHP Ganon(HTML DOM解析器)对象问题

时间:2014-08-11 16:35:52

标签: php object ganon

这是Ganon:https://code.google.com/p/ganon/

这是我的代码(请参阅评论中的问题报告):

error_reporting(E_ALL);
include_once("htmlparser.php");
$url = "https://www.origin.com/en-us/store/buy/mirrors-edge/pc-download/base-game/standard-edition";
$html = file_get_dom($url);

//DOCUMENTATION SAYS I CAN USE BOTH FORM
$body1 = $html("div.container.ageGate", 0); //BUT THIS DOESN'T WORK (Function name must be a string in...)
$body2 = $html->select("div.container.ageGate", 0); //THIS WORKS APPARENTLY

$body2->select(".row .span24 h1", 0)->getInnerText(); //THIS SHOULD GET THE CONTENT OF THE GIVEN ELEMENT, BUT IT DOES NOT WORK (Call to a member function select() on a non-object in...)

我不明白为什么代码无效。

0 个答案:

没有答案