From d1bccc3e4cd572f31c75a54dfcf4e760b1c04fa2 Mon Sep 17 00:00:00 2001 From: Thephaseless Date: Fri, 13 Sep 2024 19:00:20 +0000 Subject: [PATCH] tweaks --- src/utils/browser.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/browser.py b/src/utils/browser.py index 1f696b6..c659b81 100644 --- a/src/utils/browser.py +++ b/src/utils/browser.py @@ -74,12 +74,14 @@ async def bypass_cloudflare(page: webdriver.Tab): except asyncio.TimeoutError: if page.target.title not in CHALLENGE_TITLES: return challenged - raise if elem is None: - logger.debug("Couldn't find the title, trying again") + logger.debug("Couldn't find the title, trying other method...") continue + if not isinstance(elem, Element): + logger.fatal("Element is a string, please report this to Byparr dev") + raise InvalidElementError elem = elem.parent # Get the element containing the shadow root for _ in range(3):