Reputation: 45
I am using simple html dom parser but when I use file_get_html(), it returns empty page, but page is note empty you can check by opening in browser. Here is my code
include"11/simple_html_dom.php";
$link = "http://www.flipkart.com/transcend-storejet-25m3-2-5-inch-1-tb-external-hard-disk/p/itmd72p3y3zcsbku? pid=ACCD72ZXFC6ZRTST&srno=b_1&ref=549d7873-2897-4bd5-8451-776337341be8";
$html = file_get_html($link);
if(!empty($html)){
echo $html->find("span.fk-font-verybig") ;
}
else{
echo 'file is empty';
}
Any help would be appreciated.
Upvotes: 0
Views: 1544
Reputation: 1
Instead of echo $html->find("span.fk-font-verybig");
try echo reset( $html->find("span.fk-font-verybig") );
Upvotes: 0
Reputation: 125
Try this: in your simple_html_dom.php Edit this line define('MAX_FILE_SIZE',600000); to define('MAX_FILE_SIZE',900000); or even more according to the size of your file. This sometimes occurs when your Html file size is larger then what is define so it returns empty without any errors. I hope it works.
Upvotes: 1