parent
d489c36966
commit
02598acf10
@ -1,37 +1,37 @@ |
||||
|
||||
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': 'maik@matthes.me', |
||||
'password': 'Zxvrbhen' |
||||
} |
||||
|
||||
# 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) |
||||
|
||||
|
||||
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': 'maik@matthes.me', |
||||
'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) |
||||
|
||||
|
||||
Loading…
Reference in new issue