From ba466810ef4a6379220e77523573311d066a0438 Mon Sep 17 00:00:00 2001 From: Marc Nixon Date: Fri, 1 Sep 2023 10:33:26 -0700 Subject: [PATCH] move json output into run_all --- snowscraper/controller.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/snowscraper/controller.py b/snowscraper/controller.py index 06ea706..a77a10a 100644 --- a/snowscraper/controller.py +++ b/snowscraper/controller.py @@ -19,13 +19,12 @@ def run_all(args: argparse.Namespace): results.update(scraper.scrape()) print(results) -# Save the results to a JSON file -with open('results.json', 'w') as json_file: - json.dump(results, json_file, indent=4) - + # Save the results to a JSON file + with open('results.json', 'w') as json_file: + json.dump(results, json_file, indent=4) 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__) + importlib.import_module(f".scrapers.{name}", __package__) \ No newline at end of file