Skip to content

Commit

Permalink
fix csrf token fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
arition authored Nov 2, 2023
1 parent 4b8e28a commit 645a8e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions finance_dl/paypal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 645a8e3

Please sign in to comment.