Cook with Jamie
+By Jamie Oliver
From 5fc6dedd8eb52bf14a9f65636f225c8927bc9294 Mon Sep 17 00:00:00 2001 From: Joey <7505194+jknndy@users.noreply.github.com> Date: Sat, 14 Dec 2024 14:54:37 -0500 Subject: [PATCH] Groupings and Improved Ingredient Parsing for JamieOliver (#1434) --- recipe_scrapers/jamieoliver.py | 15 + .../jamieoliver.com/jamieoliver.testhtml | 1223 ----------------- .../{jamieoliver.json => jamieoliver_1.json} | 58 +- .../jamieoliver.com/jamieoliver_1.testhtml | 197 +++ .../jamieoliver.com/jamieoliver_2.json | 110 ++ .../jamieoliver.com/jamieoliver_2.testhtml | 155 +++ 6 files changed, 501 insertions(+), 1257 deletions(-) delete mode 100644 tests/test_data/jamieoliver.com/jamieoliver.testhtml rename tests/test_data/jamieoliver.com/{jamieoliver.json => jamieoliver_1.json} (56%) create mode 100644 tests/test_data/jamieoliver.com/jamieoliver_1.testhtml create mode 100644 tests/test_data/jamieoliver.com/jamieoliver_2.json create mode 100644 tests/test_data/jamieoliver.com/jamieoliver_2.testhtml diff --git a/recipe_scrapers/jamieoliver.py b/recipe_scrapers/jamieoliver.py index a2cf8e61e..6dccee576 100644 --- a/recipe_scrapers/jamieoliver.py +++ b/recipe_scrapers/jamieoliver.py @@ -1,4 +1,5 @@ from ._abstract import AbstractScraper +from ._grouping_utils import group_ingredients from ._utils import normalize_string @@ -12,3 +13,17 @@ def instructions(self): instructions_list = method_heading.find_next("ol") instructions = instructions_list.find_all("li") return "\n".join([normalize_string(inst.get_text()) for inst in instructions]) + + def ingredients(self): + ingredients_list = self.soup.select(".ingredients-rich-text p.type-body") + return [ + normalize_string(ingredient.get_text()) for ingredient in ingredients_list + ] + + def ingredient_groups(self): + return group_ingredients( + self.ingredients(), + self.soup, + ".ingredients-rich-text p.type-h5", + ".ingredients-rich-text p.type-body", + ) diff --git a/tests/test_data/jamieoliver.com/jamieoliver.testhtml b/tests/test_data/jamieoliver.com/jamieoliver.testhtml deleted file mode 100644 index 3c1cb875f..000000000 --- a/tests/test_data/jamieoliver.com/jamieoliver.testhtml +++ /dev/null @@ -1,1223 +0,0 @@ - - -
- - - - - - - - - - - -Just Added
About the recipe
This is a great little recipe for easy, fail-safe, gloriously gooey chocolate brownies
Recipe From
200g quality dark chocolate (70%)
250g unsalted butter
optional: 75g dried sour cherries
optional: 50g chopped nuts
80g quality cocoa powder
65g plain flour
1 teaspoon baking powder
360g caster sugar
4 large free-range eggs
Tags
Perfect Christmas gifts
Just Added
Murg makhani
About the recipe
There are so many different recipes for butter chicken. This is my take, because there is a lot of spark and dispute going on in India about butter chicken. We served so much butter chicken in our restaurant, so I went in search of the very best butter chicken recipe and researched how it all started. I found this gave me a better understanding of this best-loved dish. With its silky smooth, gently spiced tomato, cashew and cream gravy, it’s a comforting, warming dish that feels decadent. It was in 2013 when I started to take a closer look at butter chicken and its history. My mentor, chef Manjit Gill, took me to the first ever Moti Mahal restaurant in Daryagang in Delhi. A restaurant co-founded by Kundan Lal Jaggi, Kundal Lal Gujral and Maggu (also known as Thakur Das) and it was where they created both butter chicken and dal makhani.
Recipe From
750g (1 lb 10 oz) skinless, boneless chicken (thighs and breast), cut into bite-size pieces
FOR THE MARINADE
10g (½ oz) ginger root, peeled and grated (shredded)
3 large garlic cloves, peeled and grated (shredded)
2 tsp tandoori masala
1 tsp ground cumin
1 tsp ground coriander
1 tsp ground black pepper
1 tsp salt
2 tbsp yoghurt
juice of ½ lemon
30ml (1 fl oz/2 tbsp) sunflower oil
FOR THE SAUCE
500g (1 lb 2 oz) tomatoes
50g (2 oz) butter
20g (3/4 oz) ginger root, peeled and grated (shredded)
6 large garlic cloves, peeled and grated (shredded)
1 tsp tomato purée (paste)
1 tsp tandoori masala
1 tsp ground cumin
1 tsp ground coriander
1 tsp chilli powder
1 tsp salt
1 tsp sugar
30g (1½ oz) ground cashew nuts
30ml (1 fl oz/2 tbsp) double (heavy) cream
6–8 green cardamom seeds, crushed
2 tsp dried fenugreek leaves (kasoori methi)
TO SERVE
your choice of Indian flatbreads or rice
Tags