From 09197b43893a2daf359b26573bb6e3a0479bc8bb Mon Sep 17 00:00:00 2001 From: hubobel Date: Thu, 24 Jul 2025 16:46:10 +0200 Subject: [PATCH] aktueller Entwicklungsstand --- lotto2py.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lotto2py.py b/lotto2py.py index e71b610..61bbca4 100644 --- a/lotto2py.py +++ b/lotto2py.py @@ -44,10 +44,12 @@ def notify_telegram(text): requests.post(url, params=params) def Euro(): url = 'https://www.ard-text.de/mobil/583' - response = requests.get(url) + headers = { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" + } + response = requests.get(url, headers=headers) response.raise_for_status() soup = BeautifulSoup(response.text, "html.parser") - ziffern = [] ZahlenEuro = { 'Freitag': {'Datum': '', 'Z1': '', 'Z2': '', 'Z3': '', 'Z4': '', 'Z5': '', 'Eurozahl1': '', 'Eurozahl2': ''}, 'Dienstag': {'Datum': '', 'Z1': '', 'Z2': '', 'Z3': '', 'Z4': '', 'Z5': '', 'Eurozahl1': '', 'Eurozahl2': ''}} @@ -74,14 +76,13 @@ def Euro(): ZahlenEuro[Tag]['Datum'] = b tabelle = b.find_parent().find_next_sibling("table") a = 1 - print(b) + #print(b) for n in tabelle.find_all("td"): c = (n.get_text(strip=True)) b = 'Z' + str(a) ZahlenEuro[Tag][b] = int(c) a = a + 1 eurozahlen_tags = soup.find_all("b", string=lambda s: s and "eurozahlen" in s.lower()) - aa = 1 if len(eurozahlen_tags) >= 2: eurozahlen_table_2 = eurozahlen_tags[1].find_next("table") @@ -205,7 +206,7 @@ def SQLdienstag(data): resp = cursor.execute(sql_q) if resp == 0: cursor.execute(sql) - print(resp) + #print(resp) connection.commit() cursor.close() connection.close() @@ -268,7 +269,7 @@ telegram_chat_id = passw['Telegram']['Chat_ID'] telegram_token = passw['Telegram']['TOKEN'] wochentag = datetime.today().weekday() -#wochentag = 2 +wochentag = 1 if wochentag == 2: Zahl = Normalziehung(582)