I've been looking into logging in to my bank (Westpac AU) through python requests and retrieving some transaction data. I've combed through the web and stackoverflow and whilst many aim for the same goal, I don't believe I haven't seen anyone providing much detail on whether it's actually possible.
The bank in question uses Javascript and it looks they use Fiserv services to encrypt(?) certain information. They do not have an API either (for personal use).
Here's my current code (though is quite amateurish, I'm only currently experimenting) -
from requests_html import HTMLSession
from bs4 import BeautifulSoup
"""
from msedge.selenium_tools import Edge, EdgeOptions
options = EdgeOptions()
options.use_chromium = True
driver = Edge(options = options)
"""
EAM_URL = "https://banking.westpac.com.au/eam/servlet/getEamInterfaceData"
LOGIN_URL = "https://banking.westpac.com.au/wbc/banking/handler?TAM_OP=login&segment=personal&logout=false"
SUBMIT_URL = 'https://banking.westpac.com.au/eam/servlet/AuthenticateHttpServlet'
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.55",
}
data = {"username":"", "password","halgm","brand","__RequestVerificationToken","guidID"}
with HTMLSession() as session:
login_req = session.get(LOGIN_URL, cookies={}
)
eam1 = session.get(EAM_URL)
eam2 = session.get(EAM_URL)
print(dict(login_req.cookies))
I don't really know where to start either.
This is my last try before I experiment with Selenium, so I thought I'd see if anyone knows. Thanks.
Aucun commentaire:
Enregistrer un commentaire