diff --git a/modules/bouygues/browser.py b/modules/bouygues/browser.py index 5625fb5fd2805548f7a2a7a1ba5b6744f7c26a27..09dbf6126d76df0ed9c2ca0e44969a7ae815ee95 100644 --- a/modules/bouygues/browser.py +++ b/modules/bouygues/browser.py @@ -104,7 +104,15 @@ def iter_subscriptions(self): self.subscriptions_page.go() for sub in self.page.iter_subscriptions(): sub.subscriber = subscriber - sub.label = self.subscription_detail_page.go(id_account=sub.id, headers=self.headers).get_label() + try: + sub.label = self.subscription_detail_page.go(id_account=sub.id, headers=self.headers).get_label() + except ClientError as e: + if e.response.status_code == 403: + # Sometimes, subscription_detail_page is not available for a subscription. + # It's impossible to get the tel number associated with it and create a label with. + sub.label = sub.id + else: + raise yield sub @need_login