From 8d72d3af0c3296ac43191d6365734132493996aa Mon Sep 17 00:00:00 2001 From: Luciano Gervasoni Date: Tue, 8 Jul 2025 10:11:07 +0200 Subject: [PATCH] debugging --- app_selenium/missing_kids.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app_selenium/missing_kids.py b/app_selenium/missing_kids.py index c0e8929..65449c9 100644 --- a/app_selenium/missing_kids.py +++ b/app_selenium/missing_kids.py @@ -36,14 +36,17 @@ class MissingKidsFetcher(): try: # Initialize + logger.debug("Initializing driver") driver = get_webdriver() # Load URL + logger.debug("Get URL: {}".format(url)) driver.get(url) # Wait for 404? try: WebDriverWait(driver, 2).until(EC.title_contains("404")) + logger.debug("WebDriverWait -> title contains 404") except TimeoutException: - pass + logger.debug("WebDriverWait timeout, no 404 appeared") if ("404" in driver.title): # Status invalid @@ -83,6 +86,7 @@ class MissingKidsFetcher(): # atexit.register(driver.quit) # Will always be called on exit except Exception as e: logger.warning("Exception while closing/quitting driver: {}".format(str(e)), exc_info=True) + logger.info("Results: {} for URL: {}".format(str(results), url)) return results @@ -94,7 +98,9 @@ class MissingKidsFetcher(): set_urls = set() try: + logger.debug("Initializing driver") driver = get_webdriver() + logger.debug("Get URL: {}".format(url)) # Go to URL driver.get(url) # Iterate