From ad73070e6b10db6b84d8ced020ca164c215dfa61 Mon Sep 17 00:00:00 2001 From: anela Date: Fri, 21 Apr 2023 10:41:22 -0700 Subject: [PATCH] Debugging Maryland --- lottery_data_scraper/maryland.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lottery_data_scraper/maryland.py b/lottery_data_scraper/maryland.py index 53a420b..5d49778 100644 --- a/lottery_data_scraper/maryland.py +++ b/lottery_data_scraper/maryland.py @@ -7,7 +7,6 @@ import html2text import requests from selenium import webdriver from bs4 import BeautifulSoup as bs -from lotto_site_parsers.util import save_image logger = logging.getLogger(__name__) @@ -97,21 +96,23 @@ def games(requests): def fetch_games(): result_games = [] - for game in games(s): + for game in games(s)[:2]: + print("fetch_games!", game) result_games.append(game) return result_games -def save_game(game): - with client.ServerProxy(DB_REPO_URI) as c: - logger.debug("Saving game: {} - {}".format(game["game_id"], game["name"])) - c.persist([game]) +# def save_game(game): +# with client.ServerProxy(DB_REPO_URI) as c: +# logger.debug("Saving game: {} - {}".format(game["game_id"], game["name"])) +# c.persist([game]) def main(): - logger.info("Saving games to {}".format(DB_REPO_URI)) + print('inside main') + # logger.info("Saving games to {}".format(DB_REPO_URI)) for game in fetch_games(): - save_game(game) + print("main!", game) if __name__ == "__main__":