Commit 78a145b9 by Juan Pablo dure

inicio descarga de doc

1 parent 86441ff3
File mode changed
from datetime import datetime
class FosaDiaria(): class FosaDiaria():
"""Esta clase almacenara todos los datos de finalizacion de """Esta clase almacenara todos los datos de finalizacion de
...@@ -7,8 +7,12 @@ class FosaDiaria(): ...@@ -7,8 +7,12 @@ class FosaDiaria():
def __init__(self) -> None: def __init__(self) -> None:
self.Cache = {} 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: try:
data = self[dia][dominio] data = self[dia][dominio]
except: except:
...@@ -23,7 +27,17 @@ class FosaDiaria(): ...@@ -23,7 +27,17 @@ class FosaDiaria():
return(data) return(data)
def ActualizarDatosDominios(self,selenium): 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): def BajarExcel(self):
pass pass
def LimpiarCarpertaDescarga(self):
pass
#-*- coding: utf-8 -*- #-*- coding: utf-8 -*-
from flask import Flask, render_template, request, url_for, make_response, redirect from flask import Flask, render_template, request, url_for, make_response, redirect
from iselenium import SeleniumInterface as SI from iselenium import SeleniumInterface as SI
import random, json, os, datetime, ingenieros,apollo import random, json, os, datetime, ingenieros,apollo, fosadiaria
ing = ingenieros.ingenieros() ing = ingenieros.ingenieros()
FozaDiaria = fosadiaria.FosaDiaria()
app = Flask(__name__) app = Flask(__name__)
...@@ -152,6 +153,7 @@ def report(): ...@@ -152,6 +153,7 @@ def report():
d = request.json d = request.json
plate = d['header']['patente'] plate = d['header']['patente']
s = SI(SI.Chrome) s = SI(SI.Chrome)
FozaDiaria.BuscarDatosDominio(plate.upper(),selenium=s)
answer = { answer = {
"header" : {}, "header" : {},
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!