From 6d78488f65d45aa4e7e35018b0c3246cfc49d2da Mon Sep 17 00:00:00 2001 From: Revvy Date: Mon, 14 Aug 2023 20:45:02 -0400 Subject: [PATCH] fix ddg search when zero-click result is present --- engines/duckduckgo/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/duckduckgo/text.php b/engines/duckduckgo/text.php index de8d317..86e06f0 100644 --- a/engines/duckduckgo/text.php +++ b/engines/duckduckgo/text.php @@ -115,7 +115,7 @@ $xpath = get_xpath(curl_multi_getcontent($google_ch)); - foreach($xpath->query('/html/body/div[1]/div[3]/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/div") as $result) { $url = $xpath->evaluate(".//h2[@class='result__title']//a/@href", $result)[0];