From a877a474d519f84e2cc483d5c9f24a1f61426f08 Mon Sep 17 00:00:00 2001 From: Danny Spina Date: Mon, 19 Jun 2023 12:33:56 +0200 Subject: [PATCH] Try to change dukcduckgo entpoint --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 5c32989..f7728b5 100644 --- a/index.ts +++ b/index.ts @@ -14,7 +14,7 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); app.get("/", (req, res) => { - const searchEngine = "https://duckduckgo.com/html/"; + const searchEngine = "https://html.duckduckgo.com/html/"; let query = req.query.q as string; if (!query) { @@ -30,7 +30,7 @@ app.get("/", (req, res) => { res.send(`Error code ${response.statusCode}`) return; } - + const dom = new JSDOM(response.body); const links = dom.window.document.querySelectorAll('link') const results = dom.window.document.querySelectorAll('.result')