From 7a3895f7804e547f7bfb87b5ba094102cab98062 Mon Sep 17 00:00:00 2001 From: datagutten Date: Sat, 7 Sep 2024 11:35:18 +0200 Subject: [PATCH] Detect captcha requirement, fixes #2 --- apc_smartconnect/APCSmartConnect.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apc_smartconnect/APCSmartConnect.py b/apc_smartconnect/APCSmartConnect.py index efc2e6e..30eeedf 100644 --- a/apc_smartconnect/APCSmartConnect.py +++ b/apc_smartconnect/APCSmartConnect.py @@ -47,6 +47,8 @@ def get_redirect(self, page, prefix=None): def get_meta_redirect(self, page): matches = re.search(r' -1: + raise RuntimeError('Captcha required') url = matches.group(1) return self.session.get(url)