Simple Python web-scraper to get personal transaction data from BofA account.
Project description
bofa_scraper
Bank of America does not currently have a consumer-facing API for requesting balance and transaction data. The goal of this project is to make personal data accessible to allow for automated budgeting projects.
This project includes a web scraper written in Python using Selenium. As such, this project is not capable of fetching any data that could not be collected by a human in a web browser. Please always take care to secure your account credentials!
Getting Started
- Install the package.
pip install bofa_scraper
- Add the Chrome WebDriver to your project's root, or anywhere it is accessible from the command line. You'll also need the associated version of Google Chrome. These binaries are not distributed with the package because they are platform dependent.
- Import the BofAScraper class.
from bofa_scraper import BofAScraper
- Create an instance of the BofAScraper class. It is recommended that you store credentials as environment variables.
scraper = BofAScraper(
online_id='YOUR_BankOfAmerica_ONLINE_ID',
passcode='YOUR_BankOfAmerica_PASSCODE',
verbose=True # <- optional parameter for logging progress to console
)
Usage
Using the scraper: BofAScraper
constructed above:
Scrape data
Scrape and cache your account data in memory.
scraper.scrape()
During the scraping process, you may be asked via the terminal to input a 2fa code.
Access data
Returns a list[Account]
.
scraper.getAccounts()
Account:
Account.name : str # The name of the account
Account.balance : float # The balance of the account
Account.transactions : list[Transaction] # A list of this account's recent transactions
Transaction:
Transaction.date : str # Date of transaction
Transaction.amount : float # Value of transaction
Transaction.desc : str # The description of the transaction
Safely close web scraper
scraper.quit()
Security & Licensing
This repository is intended for PERSONAL USE ONLY to document/calculate finances. It is recommended that you make use of environment variables to secure personal information.
This project is licensed under the GNU General Public License 3.0 (GPLv3). You are free to use and edit the code for your personal, non-distributed use case. Any distributed derivative works of this project must be in compliance with the terms of the GPLv3 license. Distributed derivative works must be open sourced. I am not a lawyer, please read the full license included with this project to understand the totality and specificity of its terms.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file bofa_scraper-0.1.3.tar.gz
.
File metadata
- Download URL: bofa_scraper-0.1.3.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2c0ea78b2e3629337e2e9d98300c43eb1023068f0416461f348f42268983ac |
|
MD5 | ce5a98167a4b56e73e7a639759cee467 |
|
BLAKE2b-256 | b8bf48e2db8b9a286e79158b7361420560fc49323bcb227730466344a38312f8 |