-
Notifications
You must be signed in to change notification settings - Fork 572
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 lecker.de articles #611
Fix lecker.de articles #611
Conversation
lecker.de contains articles that are not formatted in a way that structured data can be extraceted. this allows to load the data into the instructions so that a mostly useful recipe is returned
@jayaddison i noticed the files fail on lint, is there a linter config anywhere so that i can format them properly? |
@vabene1111 only in GitHub Actions at the moment (this workflow file) - that could make sense though. Were you thinking of something like |
Since we have two different categories of pages for this site (articles and non-articles) it'd be good to add test coverage for each if possible (see #614 for an example of what's involved in adding a second test case - note the file suffixes and |
I am not sure, i usually just have the default profile in PyCharm active but i want to fix whatever the linter does not like, thats not clear from the CI error message, I will see if I find whats wrong from the file you linked, thanks
I can do that. I thought that articles probably change their format more often than recipes so a test that runs on a static one time copy of the page would probably not help much, but its better than nothing probably. Maybe there should be a parameter for the tests that runs all tests against the live website instead of locally to test parsers every now and then. |
ok got the formatting now, just haven't used black or flake8 much and did not now i could just run it to fix the linting. Will update all PRs |
|
||
def test_instructions(self): | ||
self.assertEqual( | ||
"\n Was ist eigentlich Naan-Brot?Als Naan-Brot bezeichnet man dünne Teigfladen aus mit Joghurt gesäuertem Hefeteig, die traditionell über dem offenen Feuer gebacken werden. In unserem Rezept übernimmt diesen Part eine heiße Pfanne. Einfaches Naan-Brot wird ausschließlich mit Salz gewürzt und typischerweise als Beilage zu heißen Gerichten wie Currys und Fleischgerichten gereicht werden. Naan-Brot Rezept - Zutaten für 6 Stück:75 ml Milch1 TL Zucker1 TL Trockenhefe1/2 TL Salz250 g + etwas Mehl1 EL Öl75 g Vollmilchjoghurt1 Ei (Gr. M) Naan-Brot Rezept - Schritt 1:Erst kommt der Löffel - dann die Hände zum EinsatzDen Backofen auf ca. 50 °C vorheizen. 75 ml Milch lauwarm erwärmen und mit 1 TL Zucker sowie 1 TL Trockenhefe verrühren. Anschließend 25 Minuten ruhen lassen. 250 g Mehl und 1/2 TL Salz mischen. Hefemilch, 1 EL Öl, 75 g Joghurt und 1 Ei zugeben. Die Teigzutaten mit einem Kochlöffel verrühren. Dann mit den Händen zu einem geschmeidigen, glatten Teig verkneten. Naan-Brot Rezept - Schritt 2:Den Teig für das Naan-Brot mit einem Küchentuch abdecken und im warmen Ofen ca. 1 Stunde gehen lassen, bis sich das Volumen verdoppelt hat. Den Teig nach dem Gehen auf einer bemehlten Arbeitsfläche noch einmal kräftig durchkneten. Dadurch wird er elastischer und besser formbar. Anschließend zu 6 Kugeln formen und diese nochmals 15 Minuten ruhen lassen.Naan-Brot Rezept- Schritt 3:Das Brot lässt sich am besten mit dem Pfannenwender drehenDie Kugeln mit der Teigrolle jeweils zu ca. 1/2 cm dünnen ovalen Fladen à ca. 18 x 10 cm ausrollen. Eine Pfanne* ohne Fett erhitzen. Die Brotfladen darin bei starker Hitze nacheinander von jeder Seite 1-2 Minuten golbraun braten. Wenn das Brot blasen wirft, wenden und von der anderen Seite braten.Tipps: Ein Pfanne aus Gusseisen ist aufgrund ihrer natürlichen Beschichtung am besten zum Braten von Naan-Brot geeignet. Mit frischem Koriander, Knoblauch oder Kümmel im Grundteig sorgst du je nach Gusto im Handumdrehen für geschmackliche Vielfalt. \n Schnelle Teig-Variante mit BackpulverFür die Zubereitung des Hefeteigs muss man etwas Zeit einplanen. Wenn es mal schnell gehen soll, kann man auch eine Naan-Brot-Variante mit Backpulver backen. Für das Rezept 250 g Mehl, 1 TL Zucker, 1 TL Backpulver sowie einen 1/2 TL Salz in einer Schüssel mischen. 75 g Vollmilchjoghurt zugeben und alles zunächst mit einem Kochlöffel verrühren und anschließen mit den Händen zu einem geschmeidigen Teig verkneten.Aus dem Teig 6 gleich große Kugeln formen und diese auf bemehlter Arbeitsfläche mit der Teigrolle zu dünnen Fladen à ca. 18 x 10 cm ausrollen. Eine Pfanne erhitzen und die Brotfladen darin bei starker Hitze von jeder Seite 1-2 Minuten braten. Sobald das Brot blasen wirft, wenden und weiterbraten.Tipp: Für echte Brotliebhaber empfehlen wir einen Brotbackautomaten \n Und dazu schmeckt Naan-Brot besonders gut:\n\n\n \nIndisches Essen\n\n\n\nweiterlesen \n\n\n\n\n\n\n \nCurry-Rezepte\n\n\n\nweiterlesen \n\n\n\n ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check why we're seeing extra newlines (like the one at the start, and the repeated ones towards the end) in the instructions
output and see if that can be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i will take a look, Will be on some business trips the next few weeks so not sure when i will get to it
Merging. Will address the comments and bump version shortly. |
fixes #448 by allowing to import body text of lecker de articles
lecker.de contains articles that are not formatted in a way that structured data can be extracted. This allows to load the data into the instructions so that a mostly useful recipe is returned.