Coder Social home page Coder Social logo

williansmartins / itauscraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from viniciusgava/itauscraper

0.0 0.0 0.0 89 KB

Download Itaú exportable files using node and Puppeteer. OFX, OFC and TXT(CSV)

License: MIT License

JavaScript 90.22% Dockerfile 8.44% Makefile 1.34%

itauscraper's Introduction

Itau Scraper

Download Itaú exportable files using node and Puppeteer. Available file formats:

  • PDF
  • XLS
  • TXT - It's a CSV with semi-colon
  • OFX - Money 2000 (DEFAULT)
  • OFC 1.0 - Money 1995 a Money 1999
  • OFC 1.06 - Quicken 6

Usage

node run.js --branch=0000 --account=00000-0 --password=000000 --days 5 

Usage - Docker

WARNING: Docker image is outdated

docker run -v $(pwd):/usr/itauscrapper/download \
    -e BRANCH='0000' \
    -e ACCOUNT='00000-0' \
    -e PASSWORD='000000' \
    -e DAYS='000000' \
    -rm \
    viniciusgava/itauscraper:latest 

Help

Usage: node run.js [options]

Options:
  --help             Show help                                         [boolean]
  --version          Show version number                               [boolean]
  --branch, -b       Itaú branch number, format: 0000        [string] [required]
  --account, -c      Itaú account number, format: 00000-0    [string] [required]
  --password, -p     Itaú account digital password(6 digits) [number] [required]
  --days, -d         Transaction log days
                          [number] [required] [choices: 3, 5, 7, 15, 30, 60, 90]
  --file_format, -f  File format to export
       [choices: "pdf", "xls", "txt", "ofx", "ofc10", "ofc106"] [default: "ofx"]
  --node_env         Node environment
        [choices: "development", "production", "docker"] [default: "production"]

Crontab

First create bash like this:

#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"

# print current date at log
date

# try 5 times
n=0
until [ $n -ge 2 ]
do
    echo "trying $n"
    /usr/bin/docker run --env-file "$SCRIPTPATH/env-configs" \
    --rm \
    viniciusgava/viniciusgava/itauscraper:latest 2>&1 && break
    n=$[$n+1]
    sleep 15
done

Mac tip: You must to pass docker full path to works at crontab /usr/local/bin/docker

Second add all env variables at env-configs. Example:

BRANCH=0000
ACCOUNT=00000-0
PASSWORD=000000
DAYS=5

DO NOT use quotation to define values on env files.

Then run crontab -e and add the follow cron. Example:

0 */4 * * * sh /home/username/automate/itauscraper/run.sh  >> /home/username/automate/itauscraper/log.log

The example bellow runs every 4 hours of all days

You can generate a different crontab config on https://crontab-generator.org

Links

Contar lançamentos

via JQUERY

TODOS Lançamentos

todos
$(".fatura__table .linha-valor-total").length

somente 9457
$(".fatura__tipo:nth-child(2)").find(".fatura__table .linha-valor-total").length

somente 5020
$(".fatura__tipo:nth-child(3)").find(".fatura__table .linha-valor-total").length

via SQL

select * from tb_lancamentos_cartao_credito tlcc 
where vencimento = '2022-11-26'	

Total da fatura

select sum(valor) 
from tb_lancamentos_cartao_credito tlcc 
where 
	vencimento = '2022-11-26'

output:

2760.96

itauscraper's People

Contributors

viniciusgava avatar williansmartins avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.