Skip to content

Commit

Permalink
🧨 Fix for handling failures and retry with Selenium.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed Aug 1, 2023
1 parent 40c7367 commit 4de5451
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/weboptout/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def check_tos_reservation(client, url: str, html: str) -> Status:
legal_words = RE_LEGAL_WORDS.findall(text)
report(S.ValidateLegalText, fail=len(legal_words) < 36)

if client._steps[-1][0:2] == (S.ValidateTextLanguage, Status.FAILURE):
if tuple(client._steps[-1][0:2]) == (Status.FAILURE, S.ValidateTextLanguage):
return Status.ABORT

if client._steps[-1][0:2] == (S.ExtractText, Status.FAILURE):
if tuple(client._steps[-1][0:2]) == (Status.FAILURE, S.ExtractText):
return Status.RETRY

assert len(client._steps) > 0
Expand Down

0 comments on commit 4de5451

Please sign in to comment.