From 21cda323c8398e05c86ba1f0bb213aff99cd2867 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Tue, 9 Jun 2015 14:21:03 +0200 Subject: [PATCH] fix crash on old website and inform users --- modules/paypal/browser.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/paypal/browser.py b/modules/paypal/browser.py index 1bd56510..2c94cb30 100644 --- a/modules/paypal/browser.py +++ b/modules/paypal/browser.py @@ -74,7 +74,10 @@ class Paypal(Browser): self.location('/myaccount') self.account_type = "perso" else: - self.location('/webapps/business/?nav=0.0') + if not self.page or self.page.document.xpath('.//a[contains(@class, "try-now-bttn")]'): + raise BrowserIncorrectPassword("Please update your account to the new PayPal website to continue to use our services") + else: + self.location('/webapps/business/?nav=0.0') if self.is_on_page(HomePage): self.account_type = "pro" else: