From 7424d7a960212ff94bc7564bc25a397f7e34599c Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 18 Oct 2024 11:04:59 +0200 Subject: [PATCH] Update internet.py --- lollms/internet.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lollms/internet.py b/lollms/internet.py index f5ad44e..3babcd3 100644 --- a/lollms/internet.py +++ b/lollms/internet.py @@ -160,7 +160,12 @@ def scrape_and_save(url, file_path:str|Path=None, use_selenium=False, follow_lin md_file.write(text + '\n\n') print(f"Texts saved to {file_path}") print(f"Images saved to {images_folder}") - + if len(results['texts'])==0: + return { + 'texts': ["Query returned no information. Please try to change the query."], + 'image_urls': [] + } + return { 'texts': results['texts'], 'image_urls': results['image_urls']