diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HTMLParser.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/HTMLParser.php b/src/HTMLParser.php index 8c3c204..5589e83 100644 --- a/src/HTMLParser.php +++ b/src/HTMLParser.php @@ -853,9 +853,9 @@ class HTMLParser // Find a better top candidate node if it contains (at least three) nodes which belong to `topCandidates` array // and whose scores are quite closed with current `topCandidate` node. $alternativeCandidateAncestors = []; - for ($i = 0; $i < count($topCandidates); $i++) { + for ($i = 1; $i < count($topCandidates); $i++) { if ($topCandidates[$i]->getContentScore() / $topCandidate->getContentScore() >= 0.75) { - $alternativeCandidateAncestors[$i] = $topCandidates[$i]->getNodeAncestors(false); + array_push($alternativeCandidateAncestors, $topCandidates[$i]->getNodeAncestors(false)); } } |