From 46fe062bd3baa0bca2aa6dfdd7fd175724398da6 Mon Sep 17 00:00:00 2001 From: Revvy Date: Tue, 29 Aug 2023 21:58:27 -0400 Subject: [PATCH] fix when ads sometimes show up with ddg --- engines/text/duckduckgo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php index 378ad4e..9993f5d 100644 --- a/engines/text/duckduckgo.php +++ b/engines/text/duckduckgo.php @@ -26,7 +26,7 @@ $results = array(); $xpath = get_xpath(curl_multi_getcontent($this->ch)); - foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div/div") as $result) + foreach($xpath->query("/html/body/div[1]/div[". count($xpath->query('/html/body/div[1]/div')) ."]/div/div/div[contains(@class, 'web-result')]/div") as $result) { $url = $xpath->evaluate(".//h2[@class='result__title']//a/@href", $result)[0];