Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jbms/finance-dl/llms.txt

Use this file to discover all available pages before exploring further.

The finance_dl.google_purchases scraper retrieves the purchase and reservation history that Google heuristically extracts from your Gmail messages. It uses selenium and chromedriver to drive the Google Takeout and Google Purchases/Reservations websites, then saves each purchase as both a raw HTML file and a structured JSON file that mirrors the Google Takeout export format.

Configuration Parameters

credentials
dict
required
A dictionary containing your Google account login credentials.
output_directory
string
required
Path on the local filesystem where output files will be written. The directory is created automatically if it does not already exist.
profile_dir
string
Path to a persistent Chrome browser profile directory used exclusively for this scraper. Do not point this at your regular browser profile. When omitted, a fresh temporary profile is created on every run.
Using a persistent profile_dir is recommended to avoid repeated Google sign-in challenges, which may require manual two-factor authentication on each run.

Output Format

Two files are written to output_directory for each purchase:
FileDescription
<id>.htmlRaw HTML content of the order details page as rendered by Google.
order_<id>.jsonStructured JSON representation of the purchase in Google Takeout Purchases/Reservations format.

Config Example

def CONFIG_google_purchases():
    return dict(
        module='finance_dl.google_purchases',
        credentials={
            'username': 'XXXXXX',
            'password': 'XXXXXX',
        },
        output_directory=os.path.join(data_dir, 'google_purchases'),
    )

Interactive Shell

From the finance-dl interactive shell, start the scraper with:
self.run()

Build docs developers (and LLMs) love