From 921ca750af2278f0f01a2ccd4e7f32b7f9efe50c Mon Sep 17 00:00:00 2001 From: Eugeniu Plamadeala Date: Thu, 19 Oct 2023 08:43:42 -0700 Subject: [PATCH] PayPal CSRF token embedding change --- 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