parent
67f0e61a6f
commit
2e58b20b4e
@ -1,38 +0,0 @@ |
|||||||
|
|
||||||
import requests |
|
||||||
from bs4 import BeautifulSoup |
|
||||||
from datetime import date |
|
||||||
|
|
||||||
# Variablen |
|
||||||
errorMsg = ('HEUTE KEIN ESSEN') |
|
||||||
menuMsg = ('Du hast bei Chemnitz.Kitchen bestellt! Heute gibt es:') |
|
||||||
today = date.today() |
|
||||||
today_url = today.strftime("%d.%m.%Y") |
|
||||||
|
|
||||||
# Login URL |
|
||||||
loginurl = ('https://chemnitz.kitchen/login/') |
|
||||||
|
|
||||||
# Bestellübersicht |
|
||||||
menu_url = f'https://chemnitz.kitchen/kunden/bestelluebersicht/?date_from={today_url}&date_to={today_url}' |
|
||||||
|
|
||||||
#Logindaten |
|
||||||
payload = { |
|
||||||
'username': 'email', |
|
||||||
'password': 'password' |
|
||||||
} |
|
||||||
|
|
||||||
# Einloggen und auf Bestellübersicht springen |
|
||||||
with requests.session() as s: |
|
||||||
s.post(loginurl, data=payload) |
|
||||||
p = s.get(menu_url) |
|
||||||
soup = BeautifulSoup(p.content, 'html.parser') |
|
||||||
table = soup.find('table' ,attrs={'class':'food-order'}) |
|
||||||
rows = table.find_all('td') |
|
||||||
description = rows[2].get_text() |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
textout = f' {menuMsg} {description}' |
|
||||||
print(textout) |
|
||||||
print(today) |
|
||||||
|
|
||||||
Loading…
Reference in new issue