From 3cf362a186615a0ee5b8fb370bae30bd7be139be Mon Sep 17 00:00:00 2001 From: John Maximilian <2e0byo@gmail.com> Date: Mon, 4 Apr 2022 20:23:05 +0100 Subject: [PATCH] fix(scraper): search in correct direction. --- yadc/scraper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yadc/scraper.py b/yadc/scraper.py index 240e58e..a598add 100644 --- a/yadc/scraper.py +++ b/yadc/scraper.py @@ -309,14 +309,14 @@ def _reserve_test(self, browser: Chrome, day: datetime, centre: str, el) -> bool # scroll to correct month attempts = 0 - while self.days_to_correct_month(browser, day) < 0: + while self.days_to_correct_month(browser, day) > 0: browser.find_element(By.CLASS_NAME, "BookingCalendar-nav--prev").click() attempts += 1 if attempts > 12: raise BookingError("Failed to find correct month by going backwards.") attempts = 0 - while self.days_to_correct_month(browser, day) > 0: + while self.days_to_correct_month(browser, day) < 0: browser.find_element(By.CLASS_NAME, "BookingCalendar-nav--next").click() attempts += 1 if attempts > 12: