Last active
October 31, 2020 18:37
-
-
Save juanitobanca/813a7e4048a7f108313c80991d1d6cc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def partidoEsValido( id_partido ): | |
pagina = f"http://www.beisbolcubano.cu/estadisticas/BoxScore?idJuego={id_partido}" | |
peticion = requests.get(pagina) | |
if peticion.status_code == 200: | |
return True | |
return False | |
rango_de_partidos = 5500 # Este valor puede cambiarlo al que usted desee. | |
partidos_validos = [] | |
for id_partido in range(rango_de_partidos): | |
print(f"Validando partido {id_partido}") | |
if partidoEsValido(id_partido): | |
partidos_validos.append(id_partido) | |
print(partidos_validos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment