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(
	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

bofa_scraper-0.1.3.tar.gz (16.5 kB view hashes)

Uploaded Source

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