current_season = 127 only_current_season = True need_stats = False cache_path = 'cache/seasons/' if need_stats: browser = Browser() crawler = Crawler() try: for i in range(current_season, 1, -1): season, matches = crawler.parse(browser, i) print season + ' ' + str(len(matches)) + ' matches' cache_season(season, matches, cache_path) if only_current_season: break except Exception as ex: browser.close_browser() raise ex browser.close_browser() seasons = get_cached_data(cache_path) analyzer = Analyzer(seasons) #analyzer.print_all_competitions() #analyzer.find_seasons_with_most_n_goal_wins(5) #analyzer.find_seasons_with_most_n_goal_games(5) analyzer.find_seasons_with_least_conceded_over_n_games(10, False)