A library for scraping transaction emails from Banorte.
⚠️ This project is no longer mantained, see banes.
The library includes 18 scrapers collected from different types of emails collected over 1 year period.
You can take a look here in order to see which emails have an scraper implemented already.
The parsing of the dates is up to you due to the weird formats Banorte uses. In my opinion those dates are not very accurate. I recommend taking a look at the timestamp of the email when it arrived in your inbox, and then comparing the two dates in order to see which one is better for your use case.
- Install the package.
npm install --save git+ssh://git@github.com/ramomar/banorte-email-scraper.git
- Require the scraper and use it!
const fs = require('fs');
const scrapeBanorteEmail = require('banorte-email-scraper');
const htmlInBase64 = fs.readFileSync('./banorte-email-in-base-64');
const html = Buffer.from(htmlInBase64, 'base64').toString();
console.log(scrapeBanorteEmail(html));
[
{
recordType: 'EXPENSE',
emailType: 'CHARGE',
note: 'COMPRA EN PAYPAL3',
operationDate: '14/May 23:32:03 hrs.',
applicationDate: '14/May/2019',
amount: '76.87',
channel: {
type: 'TPV(COMPRA COMERCIO)'
}
},
{
recordType: 'EXPENSE',
emailType: 'CASH_WITHDRAWAL_ALT',
note: 'DISPOSICION DE EFECTIVO',
operationDate: '14/May 20:15:31 hrs.',
applicationDate: '14/May/2019',
channel: {
type: 'CAJERO VISA NET'
},
amount: '337.88'
},
{
recordType: 'EXPENSE',
emailType: 'FAST_TRANSFER',
note: 'Transferencias Rápidas | Pago de una cosa',
operationDate: '06/Abr/2020 18:49:55 horas',
amount: '200.00',
extraAmounts: [{
fee: {
amount: '3.00'.
tax: '0.48'
}
}],
bank: 'SCOTIABANK',
receiver: 'Alguien'
}
]
Record type | Description |
---|---|
INCOME | A record that represents an income. |
EXPENSE | A record that represents an expense. |
ACCOUNT_OPERATION | A record that represents an account operation log (change of NIP, virtual card limit modification, etc). |
In order to test you might run npm test
.