22 lines
726 B
Python
22 lines
726 B
Python
# descargar_datos.py
|
|
"""
|
|
Script para descargar datos históricos de quinielas de fútbol español.
|
|
"""
|
|
import os
|
|
import requests
|
|
|
|
def descargar_datos(url, destino):
|
|
response = requests.get(url)
|
|
if response.status_code == 200:
|
|
with open(destino, 'wb') as f:
|
|
f.write(response.content)
|
|
print(f"Datos descargados en {destino}")
|
|
else:
|
|
print(f"Error al descargar datos: {response.status_code}")
|
|
|
|
if __name__ == "__main__":
|
|
# Ejemplo de URL de datos históricos (reemplazar por una fuente válida)
|
|
url = "https://www.example.com/quinielas_historico.csv"
|
|
destino = os.path.join(os.path.dirname(__file__), '../data/quinielas_historico.csv')
|
|
descargar_datos(url, destino)
|