aktueller Entwicklungsstand

This commit is contained in:
hubobel 2025-07-24 16:46:10 +02:00
parent b58d4e6f9e
commit 09197b4389

View file

@ -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)