hhursev / recipe-scrapers

Python package for scraping recipes data
MIT License
1.68k stars 520 forks source link

ricetteperbimby: yield described in grams is reported as unit count #1223

Open jayaddison opened 3 weeks ago

jayaddison commented 3 weeks ago

Pre-filing checks

The URL of the recipe(s) that are not being scraped correctly

The results you expect to see

The output quantity of the recipe described on the page is 750g ("750 g di crema pasticcera"), so a yields value that corresponds to that is expected.

The results (including any Python error messages) that you are seeing

>>> s.yields()
'750 servings'
jknndy commented 3 weeks ago

The get_yields util could be adjusted to handle trailing* letters or words after the quantity and print the full unit.

so 750g would be returned as 750 grams. Could be implemented to only take the characters trailing the unit or the next word and apply strict comparison against an existing list of common weights / measurements.

jayaddison commented 3 weeks ago

That's probably a good idea. I'll outline my thought process about it:

So I'm +0.5 on this - basically, proceeding cautiously with a list of widely-accepted international standard units that are commonly used in recipe ingredient descriptions.

That's probably way more of a verbose explanation than necessary -- but these are the kind of factors I'm trying to balance, and the lack of an explanation might be even more confusing.