From 645a8e32f2b27401cb5413d1b40b28729ec2b75d Mon Sep 17 00:00:00 2001 From: arition Date: Thu, 2 Nov 2023 01:44:29 -0700 Subject: [PATCH] fix csrf token fetching --- 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