From 8f807c1bd956938cb0b9655cfa1e3f88e021c466 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 11 Sep 2024 11:56:43 -0600 Subject: [PATCH] username_integer by parameter --- app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index b0d8aee..688321b 100644 --- a/app.py +++ b/app.py @@ -49,7 +49,7 @@ service = Service('/usr/bin/chromedriver') driver = None -def insert_alumno_extraccion(datos_html: str, materias_html: str, historial_html: str = 'error', materias_actuales_html: str = 'error'): +def insert_alumno_extraccion(datos_html: str, materias_html: str, username_integer: int, historial_html: str = 'error', materias_actuales_html: str = 'error'): conn = get_db_connection() # Obtener una conexión del pool try: cur = conn.cursor() @@ -78,7 +78,7 @@ def insert_alumno_extraccion(datos_html: str, materias_html: str, historial_html cur.close() release_db_connection(conn) # Liberar la conexión -def update_alumno_extraccion_error(error: str): +def update_alumno_extraccion_error(username_integer: int, error: str): conn = get_db_connection() # Obtener una conexión del pool try: cur = conn.cursor() @@ -162,12 +162,12 @@ def extract(driver, username: str, password: str): json_result = df[df['GRUPO'] != 'Promedio:'].to_json(orient='records') - query = insert_alumno_extraccion(datos_html, materias_html, json_result) + query = insert_alumno_extraccion(datos_html, materias_html, username_integer, json_result) print("Data extracted successfully") return json_result except NoSuchElementException as e: - update_alumno_extraccion_error(str(e)) + update_alumno_extraccion_error(username_integer, str(e)) app = Flask(__name__)