0
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");
}
?>
Guys, I’ve tried several ways I’ve used unset($test) and nothing happens, I’ve tried to rewrite 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...
Basically I believe it is 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’t find an answer...
for those who try to lower their class simple_html_dom
Post the class being included or a link to it. At first I would venture a guess that whoever created it used a static property where it shouldn’t.
– Bruno Augusto
Oops! I edited the text pointing the link to the class... I forgot to put.
– pdonatilio