From 92c3327b1ab6810705f6c6e9a0cf6ebd2f28727c Mon Sep 17 00:00:00 2001 From: powe97 <116031952+powe97@users.noreply.github.com> Date: Wed, 6 Mar 2024 02:09:42 -0600 Subject: [PATCH] Fix debug prints --- transfer_scraper/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/transfer_scraper/main.py b/transfer_scraper/main.py index add535e..85bb087 100644 --- a/transfer_scraper/main.py +++ b/transfer_scraper/main.py @@ -98,7 +98,10 @@ def scrape_page(page_num): jump_to_page(1, page_num, "gdvInstWithEQ", "lblInstWithEQPaginationInfo") break except Exception as e: - print("Attempt {i} failed to load page, retrying in 25 seconds...") + print( + f"Attempt {i} failed to load page, retrying in 25 seconds...", + file=sys.stderr, + ) sleep(25) num_institutions = len( @@ -118,7 +121,8 @@ def scrape_institution_safe(index, page_num): return scrape_institution(index, page_num) except Exception as e: print( - f"\tAttempt {i} failed due to {type(e).__name__}: {e}, retrying in 25 seconds..." + f"\tAttempt {i} failed due to {type(e).__name__}: {e}, retrying in 25 seconds...", + file=sys.stderr, ) sleep(25) raise Exception(f"Failed to scrape {index} after 15 attempts, aborting.")