Created
March 14, 2023 19:02
-
-
Save jmalvarez97/3a2a1ca9e53ff75e5f762b372b812015 to your computer and use it in GitHub Desktop.
Script para comprar las entradas (?
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 | |
from lxml import html | |
import time | |
from datetime import datetime | |
from tkinter import messagebox | |
from playsound import playsound | |
''' | |
Actualmente hay 4 eventos publicados en la pagina, en caso que se cambie ese numero, este script me alertara | |
''' | |
while True: | |
res = requests.get("https://www.deportick.com/") | |
source_code = html.fromstring(res.content) | |
eventosPublicados = source_code.xpath('//div[@class="col-xs-12 visible-xs"]') | |
if len(eventosPublicados) == 4: | |
print("\nHora: {}\nSiguen sin publicarse las entradas :C\n".format(datetime.fromtimestamp(time.time()))) | |
time.sleep(1800) | |
else: | |
print("\nHora: {}\nSe publicaron las entradas!\n".format(datetime.fromtimestamp(time.time()))) | |
playsound('alerta.mp3') | |
messagebox.showinfo(message="Hay un numero distinto de eventos!", title="ATENCION") | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment