From eb0280d841bd0eb29fbe79408a41cb7c6613f06b Mon Sep 17 00:00:00 2001 From: Gabriel Lobo Date: Thu, 1 Jun 2023 16:00:07 -0300 Subject: [PATCH] add data --- crawley/cli.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crawley/cli.py b/crawley/cli.py index d59f727..8a1e947 100644 --- a/crawley/cli.py +++ b/crawley/cli.py @@ -6,14 +6,12 @@ # Calls crawler results def main(args): - output_callable = get_output(args.output) + output_callable = get_output(args.output, args.data) - all_results = [] - for crawler in AVAILABLE_CRAWLERS.values(): - results = crawler.run() - all_results.extend(results) + crawler = AVAILABLE_CRAWLERS[args.crawler] + results = crawler.run() - output_callable(all_results) + output_callable(results) if __name__ == "__main__": @@ -24,7 +22,7 @@ def main(args): ) cli_parser.add_argument( - 'output', choices=['print', 'save json', 'save csv']) + 'output', choices=['print', 'save_json', 'save_csv']) args = cli_parser.parse_args() main(args)