I have the following code:
<?php
include './simple_html_dom.php';
//Este link existe
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//Aqui estou forçando um erro 404.
$teste = new simple_html_dom("http://www.btolinux.com.br/error/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
//A partir de agora todo objeto que eu criar vai estar com erro
$teste = new simple_html_dom("http://www.btolinux.com.br/");
echo $teste->original_size."<br>";
if($teste->original_size !== 0){
$teste->find("html");
}
?>
I've tried several ways I've already used unset ($ test) and nothing happens, I already tried to rewrite it using:
$teste = new simple_html_dom();
$teste->load_file("http://www.btolinux.com.br/");
OR
$teste = file_get_html("http://www.btolinux.com.br/");
And it only gets worse ...
I basically believe it to be an object persistence error in memory, since the error that appears in the 3rd object is:
Fatal error: Call to a member function find () on a non-object in /var/www/html/crawler/simple_html_dom.php on line 1113
Well, I've tried everything, but I can not find an answer ...
for anyone trying to download the class simple_html_dom