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 #964

Closed jknndy closed 8 months ago

jknndy commented 8 months ago

It looks like I closed #949 without merge after the library was refactored.

This Resolves #948

Original PR: As reported in issue https://github.com/hhursev/recipe-scrapers/issues/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.