Update internet.py

This commit is contained in:
H Lohaus 2024-11-15 18:23:07 +01:00 committed by GitHub
parent d53db73248
commit 0f81b61739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,7 +99,7 @@ async def fetch_and_scrape(session: ClientSession, url: str, max_words: int = No
async def search(query: str, n_results: int = 5, max_words: int = 2500, add_text: bool = True) -> SearchResults:
if not has_requirements:
raise MissingRequirementsError('Install "duckduckgo-search" and "beautifulsoup4" package')
async with AsyncDDGS() as ddgs:
async with DDGS() as ddgs:
results = []
for result in await ddgs.atext(
query,