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 a4475330
authored
2024-07-29 17:58:58 -0300
by
Tu Nombre
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Actualice colores y busqueda de categoria y linea
1 parent
4b35e9d3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
12 deletions
main.py
static/styles/general.css
templates/form.html
test.txt
main.py
View file @
a447533
...
...
@@ -3,7 +3,7 @@ from flask import Flask, render_template, request, url_for, make_response, redir
from
flask
import
send_from_directory
,
abort
from
iselenium
import
SeleniumInterface
as
SI
import
random
,
json
,
os
,
datetime
,
ingenieros
,
apollo
,
fosadiaria
import
configuracion
import
configuracion
,
time
from
matematika
import
*
from
titulos
import
*
import
pruebas
...
...
@@ -231,7 +231,8 @@ def report():
answer
[
'header'
][
'patente'
]
=
plate
.
upper
()
answer
[
'header'
][
"fecha-hora"
]
=
apollo
.
estaticos
.
FechaHora
()
#print(1,answer)
answer
[
'header'
][
'CodigoTaller'
]
=
configuracion
.
codigo_cent
print
(
answer
)
answer
[
'header'
][
"ingeniero"
]
=
ing
.
LeerDatosUsuario
(
request
.
cookies
[
"login"
])[
'nombreyapellido'
]
#answer['header']["hora"] = apollo.estaticos.Hora()
#print(2,answer)
...
...
@@ -272,6 +273,9 @@ def report():
#print(answer)
answer
[
'header'
][
"hora"
]
=
str
(
fingfd
)
##########Datos de linea#############################################
gotolinea
(
s
,
answer
)
##################Finalizo Scraping
s
.
driver
.
quit
()
print
(
"report"
,
answer
)
return
json
.
dumps
(
answer
)
...
...
@@ -298,6 +302,40 @@ def login(u, p, s):
else
:
raise
Exception
(
"Fallo del login"
)
def
gotolinea
(
driver_abs
,
answer
):
driver
=
driver_abs
.
driver
element
=
driver
.
find_element_by_xpath
(
'//*[@id="ui-id-5"]'
)
element
.
click
()
time
.
sleep
(
1
)
element2
=
driver
.
find_element_by_xpath
(
'//*[@id="f-cont"]/div[1]/span[2]/label'
)
text
=
element2
.
text
datos
=
text
.
split
(
"-"
)
linea
=
datos
[
0
]
.
replace
(
" "
,
""
)
#Tipo tengo que armar un rabol objetto para procesarlo
administrativo
=
driver
.
find_element_by_xpath
(
"""//*[@id="tabs"]/ul/li[6]/a[2]/span"""
)
#print("Administrativo",administrativo)
administrativo
.
click
()
time
.
sleep
(
1
)
categoria
=
driver_abs
.
find
(
SI
.
By
.
ID
,
"categoriaVehiculoId"
)
time
.
sleep
(
1
)
cat
=
"N1"
try
:
print
(
categoria
.
text
)
except
Exception
as
E
:
print
(
E
)
try
:
CatVeh
=
categoria
.
find_element_by_css_selector
(
"option[selected='selected']"
)
.
get_attribute
(
"text"
)
print
(
CatVeh
)
cat
=
CatVeh
except
Exception
as
E
:
print
(
E
)
answer
[
"header"
][
"linea_numero"
]
=
linea
answer
[
"header"
][
"vehiculo_tipo"
]
=
cat
def
gototec
(
s
,
r
):
s
.
get
(
"https://rto.cent.gov.ar/rto/RTO/listaDePlanillas"
)
...
...
static/styles/general.css
View file @
a447533
...
...
@@ -58,7 +58,7 @@ td {
background-color
:
#4CAF50
;
border-radius
:
5px
;
border
:
none
;
color
:
white
;
color
:
black
;
padding
:
15px
32px
;
text-align
:
center
;
text-decoration
:
none
;
...
...
@@ -67,7 +67,7 @@ td {
}
.AdminButton
{
background-color
:
rgb
(
85
,
17
,
211
);
background-color
:
rgb
(
69
,
16
,
168
);
border-radius
:
5px
;
border
:
none
;
color
:
white
;
...
...
@@ -79,10 +79,10 @@ td {
}
.PeligroButton
{
background-color
:
rgb
(
194
,
34
,
3
4
);
background-color
:
rgb
(
216
,
24
,
2
4
);
border-radius
:
5px
;
border
:
none
;
color
:
white
;
color
:
black
;
padding
:
15px
32px
;
text-align
:
center
;
text-decoration
:
none
;
...
...
templates/form.html
View file @
a447533
...
...
@@ -38,6 +38,8 @@
<br>
Tipo
<input
sub=
"header"
type=
"text"
name=
"vehiculo_tipo"
>
<br>
CodigoTaller
<input
sub=
"header"
type=
"text"
name=
"CodigoTaller"
readonly=
"1"
>
<br>
Cantidad Ejes
<select
type=
"text"
sub=
"alineador"
id=
"cantidad_ejes"
name=
"cantidad_ejes"
>
<option
value=
"2"
selected
>
2
</option>
<option
value=
"3"
>
3
</option>
...
...
@@ -206,13 +208,13 @@
<h1>
Datos de Suspensión
</h1>
Rend
imiento Izquierdo
- Eje 1
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_izquierdo_1"
>
Rend
. Iz.
- Eje 1
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_izquierdo_1"
>
<br>
Rend
imiento Derecho
- Eje 1
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_derecho_1"
>
Rend
. De.
- Eje 1
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_derecho_1"
>
<br>
Rend
imiento Izquierdo
- Eje 2
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_izquierdo_2"
>
Rend
. Iz.
- Eje 2
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_izquierdo_2"
>
<br>
Rend
imiento Derecho
- Eje 2
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_derecho_2"
>
Rend
. De.
- Eje 2
<input
type=
"number"
step=
"any"
sub=
"suspension"
name=
"rendimiento_derecho_2"
>
<br>
Por defecto:
<input
name=
"defecto"
id=
"defectovalor"
type=
"text"
value=
"---"
>
...
...
@@ -235,8 +237,8 @@
</button>
</div>
<button
class=
"P
DF
Button loginB"
onclick=
"location.href='/login'"
>
Login
<button
class=
"P
eligro
Button loginB"
onclick=
"location.href='/login'"
>
Cambiar Ingeniero
</button>
</div>
...
...
test.txt
View file @
a447533
...
...
@@ -15,3 +15,10 @@ Clave:hm621
//*[@id="ui-id-5"] # Boton Click Fotovalidacion, despues de levantar datos tecnicos
//*[@id="f-cont"]/div[1]/span[2]/label # Numero de linea - tipo veiculo
//*[@id="tabs"]/ul/li[6]/a[2]
//*[@id="tabs"]/ul/li[6]/a[2]/span
//*[@id="nuevoVehiculo"]/form/div[2]/fieldset/div[4]/span[2]/label/strong
\ No newline at end of file
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