repetir todos los días
This commit is contained in:
@ -23,8 +23,8 @@ Base.metadata.create_all(bind=engine)
|
|||||||
scheduler = BackgroundScheduler()
|
scheduler = BackgroundScheduler()
|
||||||
|
|
||||||
# Agregar tareas fijas
|
# Agregar tareas fijas
|
||||||
scheduler.add_job(search_from_keywords_file, "cron", hour=11, minute=0) # Ejecutar a las 11:00 AM
|
scheduler.add_job(search_from_keywords_file, "cron", hour=11, minute=0, day="*") # Ejecutar a las 11:00 AM
|
||||||
scheduler.add_job(search_from_keywords_file, "cron", hour=18, minute=0) # Ejecutar a las 6:00 PM
|
scheduler.add_job(search_from_keywords_file, "cron", hour=18, minute=0, day="*") # Ejecutar a las 6:00 PM
|
||||||
|
|
||||||
|
|
||||||
def cargar_tareas_desde_csv(indices):
|
def cargar_tareas_desde_csv(indices):
|
||||||
@ -55,7 +55,7 @@ def cargar_tareas_desde_csv(indices):
|
|||||||
for hora in range(horaInicio.hour, horaFin.hour + 1):
|
for hora in range(horaInicio.hour, horaFin.hour + 1):
|
||||||
scheduler.add_job(
|
scheduler.add_job(
|
||||||
search_indice,
|
search_indice,
|
||||||
trigger=CronTrigger(hour=hora, minute=0),
|
trigger=CronTrigger(hour=hora, minute=0, day="*"),
|
||||||
args=[obj]
|
args=[obj]
|
||||||
)
|
)
|
||||||
logging.info(f"✅ Tarea agregada para {nombre} a las {hora}:00")
|
logging.info(f"✅ Tarea agregada para {nombre} a las {hora}:00")
|
||||||
|
@ -217,7 +217,6 @@ def search_indice(indice):
|
|||||||
soup = BeautifulSoup(response.content, 'html.parser')
|
soup = BeautifulSoup(response.content, 'html.parser')
|
||||||
|
|
||||||
# Buscar los valores dentro del HTML
|
# Buscar los valores dentro del HTML
|
||||||
chart_inner_title = soup.find("span", {"data-test": "chart-inner-title"})
|
|
||||||
price = soup.find("div", {"data-test": "instrument-price-last"})
|
price = soup.find("div", {"data-test": "instrument-price-last"})
|
||||||
price_change = soup.find("span", {"data-test": "instrument-price-change"})
|
price_change = soup.find("span", {"data-test": "instrument-price-change"})
|
||||||
price_change_percent = soup.find("span", {"data-test": "instrument-price-change-percent"})
|
price_change_percent = soup.find("span", {"data-test": "instrument-price-change-percent"})
|
||||||
|
Reference in New Issue
Block a user