Reputation: 11
Does not work with this url. What is the problem? Get error - PHP Notice: Trying to get property of non-object
<?php
include ('config.php');
include('simple_html_2012.php');
echo file_get_html('http://www.localhost/test/test.html')->plaintext;
?>
if trying to parse google.com, it all works.
Upvotes: 0
Views: 629
Reputation: 63
may be helpfull:
if($source = file_get_contents("http://localhost/test/test.html"))
{
$html = str_get_html($source);
echo $html->plaintext;
}
else
{
echo "Something wrong!";
}
Upvotes: 0
Reputation: 373
echo file_get_html('http://localhost/test/test.html')->plaintext;
or
echo file_get_html('http://127.0.0.1/test/test.html')->plaintext;
Upvotes: 3