Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Luciano Barletta
/
Pruebas-RTO
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit fe25f9cb
authored
2023-10-03 08:19:42 -0300
by
Juan Pablo dure
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
se agrega borradores
1 parent
ecde580c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
configuracion.py
fosadiaria.py
configuracion.py
0 → 100644
View file @
fe25f9c
carpetaDescargas
=
"/home/juan/Descargas/"
cabezaeraDescargas
=
"Planilla_Diaria"
\ No newline at end of file
fosadiaria.py
View file @
fe25f9c
from
datetime
import
datetime
from
time
import
sleep
import
os
from
configuracion
import
*
import
pandas
as
pd
class
FosaDiaria
():
"""Esta clase almacenara todos los datos de finalizacion de
...
...
@@ -9,6 +12,8 @@ class FosaDiaria():
def
__init__
(
self
)
->
None
:
self
.
Cache
=
{}
self
.
Archivo
=
"data/fosa.json"
self
.
cabezaera
=
cabezaeraDescargas
self
.
CarpetaDescarga
=
carpetaDescargas
def
BuscarDatosDominio
(
self
,
dominio
,
selenium
,
dia
=
False
):
if
dia
==
False
:
...
...
@@ -28,22 +33,34 @@ class FosaDiaria():
return
(
data
)
def
ActualizarDatosDominios
(
self
,
selenium
):
self
.
BajarExcel
(
selenium
)
archivo
=
self
.
BuscarExcelDescargado
()
df
=
pd
.
read_excel
(
archivo
)
print
(
df
)
def
BajarExcel
(
self
,
selenium
):
self
.
LimpiarCarpertaDescarga
()
selenium
.
get
(
"https://rto.cent.gov.ar/rto/RTO/planillaDiaria"
)
now
=
datetime
.
now
()
dia
=
now
.
strftime
(
"
%
d"
)
mes
=
now
.
strftime
(
"
%
m"
)
ano
=
now
.
strftime
(
"
%
Y"
)
self
.
LimpiarCarpertaDescarga
()
#sleep(5)
URL
=
f
"""https://rto.cent.gov.ar/rto/report/planillaDiariaEXCEL/planillaDiariaEXCEL?codTaller=54&fechaConsulta={dia}
%2
F{mes}
%2
F{ano}&agruparPorLinea=false&format=excel&extension=xls"""
print
(
URL
)
selenium
.
get
(
URL
)
#sleep(5)
self
.
BajarExcel
()
def
BajarExcel
(
self
):
pass
def
BuscarExcelDescargado
(
self
,
tmp
=
"/dev/shm/tmpscdecas.txt"
):
rta
=
""
os
.
system
(
f
"""ls {self.CarpetaDescarga} -ls > {tmp}"""
)
file1
=
open
(
tmp
,
'r'
)
Lines
=
file1
.
readlines
()
for
line
in
Lines
:
print
(
"Line: {}"
.
format
(
line
.
strip
()))
file1
.
close
()
os
.
system
(
f
"""rm {tmp}"""
)
return
rta
def
LimpiarCarpertaDescarga
(
self
):
pass
os
.
system
(
f
"""rm {self.CarpetaDescarga}{self.cabezaera}*"""
)
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment