Skip to content

Downloading Fidelity Charitable & Cigna Health Records

Tags: finance, health, javascript • Categories: Productivity

Table of Contents

Similar to my post about Amazon Photos and Wealthfront data extraction, here’s another set of scripts to download data from sites which have terrible interfaces.

You can use both of these scripts by opening up the developer console and copy/pasting/executing them. Hopefully it saves someone some time!

Download All Cigna Medical Claim PDFs

This script will download all medical claim PDFs on Cigna over the last year. First, navigate to the claims summary page. Then set the filter to: view all, last year, for all people.

Now execute this script:

$x("//a[contains(text(), 'Download EOB')]").forEach(el => {
// this is a special line which actually allows the claims to be downloaded
el.download = $('.date', el.parentNode).innerText;
var e = document.createEvent('MouseEvents')
e.initEvent('click' ,true ,true)
el.dispatchEvent(e)
})

Here’s more explanation on why this trick works.

Download All Fidelity Charitable Contributions

As I’ve written about, I use a Fidelity Charitable DAF (which I highly recommend) to manage all charitable contributions. For tax purposes, you are required to keep a log of all contributions to the DAF. However, Fidelity doesn’t provide you a way to download all PDF contribution records and, if I remember properly, they don’t promise to keep the records for more than a year.

Go to the contribution history page and run this script:

$x("//a[contains(@href, "fc-services/api/v1/document/download")]").forEach(el => { el.download = el.text.replace("(PDF)", "").replace("/", "-") + ".pdf"; var e = document.createEvent('MouseEvents'); e.initEvent('click' ,true ,true); el.dispatchEvent(e);})