diff --git a/snowscraper/controller.py b/snowscraper/controller.py index 792ae6c..06ea706 100644 --- a/snowscraper/controller.py +++ b/snowscraper/controller.py @@ -19,12 +19,13 @@ 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) + + 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)