dom - PHP : Ganon get html of a block -


i working ganon dom parser html parsing , trying content div block reason returned object not working, below code , using :

<?php set_time_limit(0); #include dom parser lib. require_once('ganon.php');  $html = file_get_dom('http://jlc.watchprosite.com/?show=forumpost&amp;fi=2&amp;pi=1818820&amp;ti=279373&amp;msid=&amp;s='); print_r($html("div[id='sidebar']")->childcount());  ?> 

this gives

fatal error: call member function childcount() on non-object in d:\xampp\htdocs\govberg\test.php on line 7 

when print_r($html) printing large object.

anyboby able point out whats going wrong..

try like,

if ($html("div[id='sidebar']",0)){ // or use # if ($html("div#sidebar",0)){     echo 'total children '.$html("div[id='sidebar']",0)->childcount(); } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -