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
[HelloFresh] Recipe-scraper does not return the correct amount of ingredients for Hellofresh #527
Comments
Looking at the source of the recipe you linked reveals the issue: The amounts per serving visible on the html site are different from the amounts per serving in the schema.org json which is embedded on the site. This is the embedded json and that's why its wrong: "recipeIngredient": [
"½ pièce Gousse d'ail",
"¼ pièce Oignon jaune",
"½ pièce Poireau",
"50 g Ricotta",
"100 g Épinards",
"1 selon le goût Noix de muscade",
"20 g Fromage italien râpé",
"100 g Feuilles de lasagne fraîches",
"113 g Miettes de saumon fumé à chaud",
"10 g Noisettes grillées",
"30 g Tomates semi-séchées",
"½ cs Huile d'olive",
"½ cc Vinaigre de vin blanc",
"15 g Beurre",
"15 g Farine",
"275 ml Lait",
"½ cc Moutarde",
"½ cs Vinaigre balsamique noir",
"selon le goût Poivre et sel"
],
"recipeYield": 2, Is it wrong for all recipes from hellofresh or only for some? |
@gloriousDan, Yes i tested some recipes all have the same issue unfortunately. it's not only for the recipe. Yes i think it s better to try scraping the correct recipeYield from the HTML. |
We gotta fix this indeed.. By browsing the site I'm with the impression that this problem will be happening only if the recipe has "serving amount 1" as an option. |
That's interesting. It seems like all french hellofresh links (as far as I've checked) have the "serving amount 1" option while recipes in most other languages (e.g.: https://www.hellofresh.com/recipes/uk-balsamic-streak-with-red-cabb-5841a8ad9df18165854cdd72 as an example for an english recipe) only have the "serving amount 2" or larger settings. Maybe we can assume that the ingredient amounts listed in the schema correspond to the lowest selectable serving amount. |
@gloriousDan : I made the same observation that for the recipes in French the minimum portion was one and in the other languages from two. We can make this assumption but I think it can confuse users, especially if it is not specified anywhere saying that for French the 2 serving displayed by recipe-scraper should not be taken into account, but that the value minimum is one. |
What I meant is, that based on this assumption we could implement something in the hellofresh scraper, which gets the correct serving count from the html instead of fron the schema. |
@gloriousDan : I agree with you. 👍 |
I just raised the issue with the hellofresh.fr customer support Transcript of customer support chat
The question is if and when they will fix it. When implementing the fix we should take care that it doesn't break again if the issue gets fixed. |
I say we wait around 4 weeks for hellofresh to fix it on their end. If after 4 weeks the problem persists we'll do the ad-hoc solution in our code |
ok @hhursev ! thank you so much for your reactivity as well as that of @gloriousDan. |
2 months have passed now and I just had a quick look at https://www.hellofresh.com/recipes/wraps-aux-galettes-quinoa-tomates-6255db99b7800a4ac46cb29e where the error still persists. |
The best that comes to my mind is simply detecting if there's serving size "1" on the recipe page, and prepending |
From what I've seen so far I think this should work. I'm not sure if it's true for all recipes from hellofresh though since I didn't look at too many |
Thanks for filing a bug report with us!
If your request is about a website that is not supported, please open a 'new scraper' issue request instead.
To help get the issue fixed, please fill in the information below.
Pre-filing checks
The URL of the recipe(s) that are not being scraped correctly
The version of Python you're using
Python 3.9.5
The operating system of your environment
Ubuntu 21.04
The results you expect to see
For 2 servings we would have:
The results (including any Python error messages) that you are seeing
½ pièce Gousse d'ail", '¼ pièce Oignon jaune', '½ pièce Poireau'
Can you write Python and would you like to help fix the scraper yourself? We'd be glad for your assistance! We can provide you with guidance and code review in return. If so, tick any of the relevant boxes below:
recipe-scrapers
team try to fix thisThe text was updated successfully, but these errors were encountered: