Answer the question
In order to leave comments, you need to log in
Why does Simple HTML Dom find extra elements?
For some unknown reason, the parser finds elements that I don't see in the page code.
<?php
include_once 'simple_html_dom.php';
$url = 'http://www.felix.ru';
$html = new simple_html_dom();
$html -> load_file($url);
foreach ($html->find('a.Depth[href*=catalog], a.Depth2[href*=catalog]') as $e) {
echo $e->href . '<br>';
}
Answer the question
In order to leave comments, you need to log in
The page that you are viewing in the browser and that your script received may be different even if the url is the same.
Therefore, save the resulting html to a file for debugging. And compare the results of the script with the contents of the file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question