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: