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

Fix dresden parser #90

Closed
wants to merge 0 commits into from
Closed

Fix dresden parser #90

wants to merge 0 commits into from

Conversation

hesstobi
Copy link
Contributor

@hesstobi hesstobi commented Jan 7, 2019

Studentenwerk Dresden launched a redesign of their webpage, thus the parser was not working anymore.

@hesstobi
Copy link
Contributor Author

hesstobi commented Jan 7, 2019

I don't like failing tests...therefore fixed marburg

Copy link
Collaborator

@klemens klemens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work! It does look quite good already! But please, don't use exceptions for control flow if not necessary. 😉

I will review the marburg parser separately.

parsers/dresden.py Outdated Show resolved Hide resolved
parsers/dresden.py Outdated Show resolved Hide resolved
parsers/dresden.py Outdated Show resolved Hide resolved
parsers/dresden.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@klemens klemens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some minor issues, but overall this also looks very good! I did not add comments for "exception as control flow", but there are definitely 5 too many AttributeErrors in this parser. 😉

I also notices, that the side dishes are sometimes formatted strangely, eg:

<span class="neo-menu-single-title">
                          , Schokoladenpudding mit Vanillesauce (<abbr title="Milch"><abbr title="Milch"><abbr title="Milch">22</abbr></abbr></abbr>) , Joghurtdessert (<abbr title="Milch"><abbr title="Milch"><abbr title="Milch">22</abbr></abbr></abbr>) ,Waldbeeren-Sahnequark (<abbr title="Milch"><abbr title="Milch"><abbr title="Milch">22</abbr></abbr></abbr>)                        </span>

Which results in:

<category name="Beilagen: Dessert">
  <meal>
    <name>, Schokoladenpudding mit Vanillesauce , Joghurtdessert ,Waldbeeren-Sahnequark </name>
    <note>Milch</note>
  </meal>
</category>

Ideally, we would want something like Schokoladenpudding mit Vanillesauce, Joghurtdessert, Waldbeeren-Sahnequark, so maybe strip(", ") and then re.sub(r'\s*,\s*', ", ", name)? We can also add this later.

parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
parsers/marburg.py Outdated Show resolved Hide resolved
@klemens
Copy link
Collaborator

klemens commented Feb 3, 2019

Thanks! I squashed the commits into one for each parser and merged them. There seems to be a problem with hannover (I will take a look at it) and #89 is still a problem, so it might take a while before the changes are visible unfortunately.

@klemens
Copy link
Collaborator

klemens commented Feb 4, 2019

So, hannover is fixed and I now host the parsers myself. So dresden and marburg should start working again tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants