hhursev / recipe-scrapers

Python package for scraping recipes data
MIT License
1.66k stars 514 forks source link

Moved Allrecipes ingredients scraper from schema to html #949

Closed jknndy closed 9 months ago

jknndy commented 9 months ago

As reported in issue #948, allrecipe's recipes containing fractions that don't convert to decimal evenly are currently printing out as decimals. For instance, 1/3 cup of butter is currently represented as 0.33333334326744 cup of butter in the schema.

"recipeIngredient": [
"5 large eggs",
"0.33333334326744 cup butter, melted and slightly cooled",
"0.25 cup white sugar",
"0.5 cup milk",
"0.25 cup cornstarch",
"1 (15.25 ounce) can whole kernel corn, drained",
"2 (14.75 ounce) cans cream-style corn" ]

This PR swaps over to an html scrape that returns the ingredient list with the correct unicode fraction as presented on the site. Also pulled an updated copy of the testhtml, it seems this one was either missed in the updates or the site changed their structure very recently.

Resolves #948

jayaddison commented 9 months ago

Generally looks good! Perhaps we should wait until after #944 is merged before merging this?