Commit 78a145b9 by Juan Pablo dure

inicio descarga de doc

1 parent 86441ff3
File mode changed
from datetime import datetime
class FosaDiaria():
"""Esta clase almacenara todos los datos de finalizacion de
......@@ -7,8 +7,12 @@ class FosaDiaria():
def __init__(self) -> None:
self.Cache = {}
self.Archivo = "data/fosa.json"
def BuscarDatosDominio(self,dominio,dia,selenium):
def BuscarDatosDominio(self,dominio,selenium,dia=False):
if dia == False:
now = datetime.now()
dia = now.strftime("%d/%m/%Y")
try:
data = self[dia][dominio]
except:
......@@ -23,7 +27,17 @@ class FosaDiaria():
return(data)
def ActualizarDatosDominios(self,selenium):
pass
now = datetime.now()
dia = now.strftime("%d")
mes = now.strftime("%m")
ano = now.strftime("%Y")
self.LimpiarCarpertaDescarga()
URL = f"""https://rto.cent.gov.ar/rto/report/planillaDiariaEXCEL/planillaDiariaEXCEL?codTaller=54&fechaConsulta={dia}%2F{mes}%2F{ano}&agruparPorLinea=false&format=excel&extension=xls"""
selenium.get(URL)
self.BajarExcel()
def BajarExcel(self):
pass
def LimpiarCarpertaDescarga(self):
pass
#-*- coding: utf-8 -*-
from flask import Flask, render_template, request, url_for, make_response, redirect
from iselenium import SeleniumInterface as SI
import random, json, os, datetime, ingenieros,apollo
import random, json, os, datetime, ingenieros,apollo, fosadiaria
ing = ingenieros.ingenieros()
FozaDiaria = fosadiaria.FosaDiaria()
app = Flask(__name__)
......@@ -152,6 +153,7 @@ def report():
d = request.json
plate = d['header']['patente']
s = SI(SI.Chrome)
FozaDiaria.BuscarDatosDominio(plate.upper(),selenium=s)
answer = {
"header" : {},
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!