Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halle: snake_case variable and category for salad #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions parsers/halle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ def parse_data(self, **kwargs):
data = self.parse_remote('https://www.meine-mensa.de/speiseplan_iframe',
args=kwargs)

menuContainer = data.find('div', attrs={'class': 'card mt-3'})
menu_container = data.find('div', attrs={'class': 'card mt-3'})

if menuContainer != None:

if menu_container != None:
pos = 0
for div in menuContainer.find_all('div', recursive=False):
for div in menu_container.find_all('div', recursive=False):
if pos == 0:
if self.needed_title:
assert self.needed_title in div.text, div.text
Expand All @@ -39,8 +38,10 @@ def parse_data(self, **kwargs):
if not name:
continue

if name == 'Dessertschälchen vom Büfett':
if name.startswith('Dessertschälchen'):
category = 'Dessert'
elif name.startswith('Buntes Salatschälchen'):
category = 'Salat'
else:
category = 'Hauptessen'

Expand Down