docker ready sin pruebas

This commit is contained in:
Your Name
2025-02-06 17:19:30 +01:00
parent 03d334fade
commit 85228eeda9
8 changed files with 159 additions and 95 deletions

View File

@ -2,6 +2,15 @@ import json
import requests
import sys
from bs4 import BeautifulSoup
import logging
# Configuración del logging
LOG_FILE = "app.log"
logging.basicConfig(
filename=LOG_FILE, # Archivo de logs
level=logging.INFO, # Nivel de logging (DEBUG, INFO, WARNING, ERROR, CRITICAL)
format="%(asctime)s - %(levelname)s - %(message)s", # Formato de los logs
)
def download_html_as_human(url):
"""
@ -70,7 +79,7 @@ def get_author_from_url(url):
"""
html_content = download_html_as_human(url)
if not html_content:
print("error")
logging.info("error, no se pudo descargar la pagina")
return "No se pudo descargar la página."
soup = BeautifulSoup(html_content, 'html.parser')