Skip to main content

Simple Python web-scraper to get personal transaction data from BofA account.

Project description

bofa_scraper

version downloads

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

  1. Install the package.
pip install bofa_scraper
  1. 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.
  2. Import the BofAScraper class.
from bofa_scraper import BofAScraper
  1. Create an instance of the BofAScraper class. It is recommended that you store credentials as environment variables.
scraper = BofAScraper(
	'YOUR_BankOfAmerica_ONLINE_ID',
	'YOUR_BankOfAmerica_PASSCODE'
	)

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

bofa_scraper-0.1.2.tar.gz (16.2 kB view details)

Uploaded Source

File details

Details for the file bofa_scraper-0.1.2.tar.gz.

File metadata

  • Download URL: bofa_scraper-0.1.2.tar.gz
  • Upload date:
  • Size: 16.2 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

Hashes for bofa_scraper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b3389fe4d4c707b91b5b05784230d923dda4efb934b43e42e01aa5c44cfd7d1
MD5 9342af90b5321a437492f9c7a9819d2e
BLAKE2b-256 c39a89cb81ecb48235617c845c17c2799e32661be48138cf97eb0602c65a6d43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page