From 4bacc5c74c244b25d9cba79a1fcee207553bb55e Mon Sep 17 00:00:00 2001 From: arition Date: Thu, 2 Nov 2023 12:43:59 -0400 Subject: [PATCH] fix csrf token fetching (#92) --- finance_dl/paypal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/finance_dl/paypal.py b/finance_dl/paypal.py index 31b120d..3148c38 100644 --- a/finance_dl/paypal.py +++ b/finance_dl/paypal.py @@ -175,8 +175,8 @@ def get_csrf_token(self): logging.info('Getting CSRF token') self.driver.get('https://www.paypal.com/myaccount/transactions/') # Get CSRF token - body_element, = self.wait_and_locate((By.ID, "__react_data__")) - attribute_object = json.loads(body_element.get_attribute("data")) + body_element, = self.wait_and_locate((By.ID, "__APP_DATA__")) + attribute_object = json.loads(body_element.get_attribute("innerHTML")) self.csrf_token = attribute_object["_csrf"] return self.csrf_token