|
|
|
|
@ -1,4 +1,3 @@ |
|
|
|
|
|
|
|
|
|
import requests |
|
|
|
|
import json |
|
|
|
|
from bs4 import BeautifulSoup |
|
|
|
|
@ -8,8 +7,8 @@ from datetime import date |
|
|
|
|
errorMsg = ('HEUTE KEIN ESSEN') |
|
|
|
|
menuMsg = ('Du hast bei Chemnitz.Kitchen bestellt! Heute gibt es:') |
|
|
|
|
today = date.today() |
|
|
|
|
#today_url = today.strftime("%d.%m.%Y") |
|
|
|
|
today_url = ('30.11.22') |
|
|
|
|
today_url = today.strftime("%d.%m.%Y") |
|
|
|
|
#today_url = ('05.12.22') |
|
|
|
|
|
|
|
|
|
# Login URL |
|
|
|
|
loginurl = ('https://chemnitz.kitchen/login/') |
|
|
|
|
@ -18,14 +17,14 @@ loginurl = ('https://chemnitz.kitchen/login/') |
|
|
|
|
menu_url = f'https://chemnitz.kitchen/kunden/bestelluebersicht/?date_from={today_url}&date_to={today_url}' |
|
|
|
|
|
|
|
|
|
#Logindaten |
|
|
|
|
payload = { |
|
|
|
|
login = { |
|
|
|
|
'username': 'email', |
|
|
|
|
'password': 'password' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Einloggen und auf Bestellübersicht springen |
|
|
|
|
with requests.session() as s: |
|
|
|
|
s.post(loginurl, data=payload) |
|
|
|
|
s.post(loginurl, data=login) |
|
|
|
|
p = s.get(menu_url) |
|
|
|
|
soup = BeautifulSoup(p.content, 'html.parser') |
|
|
|
|
table = soup.find('table' ,attrs={'class':'food-order'}) |
|
|
|
|
@ -52,3 +51,4 @@ datei.close() |
|
|
|
|
print(textout) |
|
|
|
|
print(dictionary_string) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|