Skip to content

Commit

Permalink
feat(browser): even more explicit logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
2e0byo committed Feb 17, 2022
1 parent a6c8ca0 commit 98cde22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions yadc/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ def wait(self):
waited = 0
if self.WAIT_MSG in self.page_source:
self._logger.debug("Waiting as page is not ready yet.")
while self.WAIT_MSG in self.page_source and waited < self.MAX_WAIT:
sleep(1)
waited += 1
if self.WAIT_MSG in self.page_source:
raise BrowserError(f"Page failed to load within {self.MAX_WAIT} s")
while self.WAIT_MSG in self.page_source and waited < self.MAX_WAIT:
sleep(1)
waited += 1
if self.WAIT_MSG in self.page_source:
raise BrowserError(f"Page failed to load within {self.MAX_WAIT} s")
else:
self._logger.debug("No need to wait for page.")

def find_element(self, by=None, value=None, bypass=True, wait=True):
if bypass:
Expand Down

0 comments on commit 98cde22

Please sign in to comment.