Skip to content

Commit

Permalink
fix(scraper): search in correct direction.
Browse files Browse the repository at this point in the history
  • Loading branch information
2e0byo committed Apr 4, 2022
1 parent 45bb8d7 commit 3cf362a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yadc/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3cf362a

Please sign in to comment.