php - DOMXPath var_dump: "(object value omitted)" -


this question has answer here:

$store = curl_exec($ch); // returns page of html  $doc = new domdocument(); $doc->loadhtml($store); $xpath = new domxpath($doc); 

vardump $xpath:

object(domxpath)#2 (1) {      ["document"] => string(22) "(object value omitted)"  }  

what wrong here? i'm trying use xpath on html code extract info.

object(domdocument)#1 (34) {     ["doctype"]         => string(22) "(object value omitted)"      ["implementation"]  => string(22) "(object value omitted)"      ["documentelement"] => string(22) "(object value omitted)"      ["actualencoding"]  => string(6) "gb2312"      ["encoding"]        => string(6) "gb2312"     ["xmlencoding"]     => string(6) "gb2312"      ["standalone"]      => bool(true)      ... 

loadhtmlfile requires path of html file not content of html file loadhtmlfile. code be

$doc = new domdocument(); $doc->loadhtmlfile("path html file"); $xpath = new domxpath($doc); 

edit

if want load html content use loadhtml

$doc = new domdocument(); $doc->loadhtml($store); $xpath = new domxpath($doc); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -