From 04d13f02c44b08e60bdcff91cd675d51c3460306 Mon Sep 17 00:00:00 2001 From: Marc Nixon Date: Fri, 1 Sep 2023 10:19:55 -0700 Subject: [PATCH] results into json --- snowscraper/controller.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snowscraper/controller.py b/snowscraper/controller.py index 3cb5327..d9d9473 100644 --- a/snowscraper/controller.py +++ b/snowscraper/controller.py @@ -23,3 +23,7 @@ def import_scrapers(): directory = Path(__file__).resolve().parent / "scrapers" for module_loader, name, ispkg in pkgutil.iter_modules([directory]): importlib.import_module(f".scrapers.{name}", __package__) + +# Save the results to a JSON file +with open('results.json', 'w') as json_file: + json.dump(results, json_file, indent=4)