From 17c4e938ae06d988fb6def364dfc4d9126cb3f6a Mon Sep 17 00:00:00 2001 From: "N0\\A" Date: Thu, 23 Oct 2025 13:36:03 +0200 Subject: [PATCH] web search p1 --- core/web_search.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/web_search.py b/core/web_search.py index 6fceddd..c7d338c 100644 --- a/core/web_search.py +++ b/core/web_search.py @@ -1,14 +1,6 @@ import webbrowser -import ddg +from duckduckgo_search import DDGS -def search(query: str) -> None: - """Performs a web search using the default browser. - - Args: - query (str): The search query. - """ - if not query: - raise ValueError("Search query cannot be empty.") - - url = f"https://www.google.com/search?q={query.replace(' ', '+')}" - webbrowser.open(url) \ No newline at end of file +def search(query): + results = DDGS().text("python programming", max_results=10) + print(results) \ No newline at end of file