diff --git a/internal/scraper/nigella.go b/internal/scraper/nigella.go index 6d71b54f..a4fbb6cb 100644 --- a/internal/scraper/nigella.go +++ b/internal/scraper/nigella.go @@ -14,14 +14,28 @@ func scrapeNigella(root *goquery.Document) (models.RecipeSchema, error) { if ok { name = strings.TrimSpace(before) } + if name == "" { + name = root.Find("h1[itemprop=name]").Text() + } rs.Name = name rs.Yield.Value = findYield(root.Find("p[class=serves]").Text()) untrimmedDescription := getPropertyContent(root, "og:description") description, _ := strings.CutSuffix(untrimmedDescription, "\n\nFor US cup measures, use the toggle at the top of the ingredients list.") + if description == "" { + description = getNameContent(root, "description") + } rs.Description.Value = description + rs.Image.Value = getPropertyContent(root, "og:image") + if rs.Image.Value == "" { + img := root.Find("img[itemprop=image]").AttrOr("src", "") + if strings.HasPrefix(img, "/assets") { + img = "https://www.nigella.com" + img + } + rs.Image.Value = img + } rs.Keywords.Values = root.Find("meta[itemprop=keywords]").AttrOr("content", "") diff --git a/internal/scraper/scraper_N_test.go b/internal/scraper/scraper_N_test.go index 3e8a52a2..36dadeff 100644 --- a/internal/scraper/scraper_N_test.go +++ b/internal/scraper/scraper_N_test.go @@ -103,6 +103,51 @@ func TestScraper_N(t *testing.T) { Video: &models.Videos{}, }, }, + { + name: "nigella2.com", + in: "https://www.nigella.com/recipes/guests/coffee-baklava-with-dried-figs", + want: models.RecipeSchema{ + AtContext: "https://schema.org", + AtType: &models.SchemaType{Value: "Recipe"}, + Category: &models.Category{Value: "uncategorized"}, + CookingMethod: &models.CookingMethod{}, + Cuisine: &models.Cuisine{}, + Description: &models.Description{Value: "The figs give this baklava a natural sweetness, but if you don’t have any, simply replace them with the same amount of extra nuts."}, + Keywords: &models.Keywords{ + Values: "Birthdays, Christmas, Partytime, Comfort, Fun, Indulgent, Nibbly, Sociable, Sweet, Baking, Guest Recipe,", + }, + Image: &models.Image{Value: anUploadedImage.String()}, + Ingredients: &models.Ingredients{ + Values: []string{ + "150 grams shelled pistachios (toasted, plus extra to serve)", + "200 grams walnuts (toasted)", "100 grams soft dried figs (finely chopped)", + "1 teaspoon ground cinnamon", "80 grams caster sugar", "375 grams filo pastry", + "150 grams unsalted butter (melted)", + "2 tablespoons Oasis Greek coffee or other Greek or Turkish finely ground coffee", + "175 grams honey", + "230 grams caster sugar", + }, + }, + Instructions: &models.Instructions{ + Values: []models.HowToItem{ + {Text: "For the Greek coffee honey syrup, combine the ingredients and 150 ml (5 fl oz) of water in a small saucepan over high heat. Bring to a simmer, then reduce the heat to medium and cook, stirring occasionally, for 8–10 minutes, until the sugar dissolves. Set aside to cool.", Type: "HowToStep"}, + {Text: "Preheat the oven to 180°C (350°F). Grease the base and sides of a 20 cm × 30 cm (8 in × 12 in) baking tin and line with baking paper.", Type: "HowToStep"}, + {Text: "Pulse the nuts in a food processor until finely chopped (take care not to overprocess the nuts, otherwise you’ll end up with nut paste). Transfer the nuts to a bowl and stir through the fig, cinnamon and sugar.", Type: "HowToStep"}, + {Text: "Carefully lay the filo pastry sheets on a chopping board and trim the sheets to fit the size of the prepared pan or tin. Discard any pastry offcuts. Cover the filo pastry with a clean, slightly damp tea towel, to prevent the sheets from drying out.", Type: "HowToStep"}, + {Text: "Brush one filo pastry sheet with butter, then place in the prepared tin. Repeat with another seven sheets of filo pastry, buttering each layer. Scatter over one-third of the nut mixture and top with another four filo sheets, brushing each layer with butter. Repeat this process twice more. Gently press the final filo layer to compress the baklava slightly. Brush generously with the remaining butter.", Type: "HowToStep"}, + {Text: "Using a small sharp knife, score the top filo layer into 24 squares. Bake for 25–30 minutes, until the pastry is golden and crispy.", Type: "HowToStep"}, + {Text: "Pour the cooled coffee honey syrup over the hot baklava and stand for 1 hour or until the baklava is cool. Using a sharp knife, cut the baklava into pieces along the score marks and serve.", Type: "HowToStep"}, + }, + }, + Name: "Coffee Baklava With Dried Figs", + NutritionSchema: &models.NutritionSchema{}, + ThumbnailURL: &models.ThumbnailURL{}, + Tools: &models.Tools{Values: []models.HowToItem{}}, + Yield: &models.Yield{Value: 24}, + URL: "https://www.nigella.com/recipes/guests/coffee-baklava-with-dried-figs", + Video: &models.Videos{}, + }, + }, { name: "ninjatestkitchen.eu", in: "https://ninjatestkitchen.eu/recipe/dirt-worm-brownies", diff --git a/internal/scraper/testdata/nigella2.html b/internal/scraper/testdata/nigella2.html new file mode 100644 index 00000000..65afe28d --- /dev/null +++ b/internal/scraper/testdata/nigella2.html @@ -0,0 +1,1921 @@ + + + + + + + + + + + + Coffee Baklava With Dried Figs | Guest Recipes | Nigella's Recipes | Nigella Lawson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + youtube + + + + pinterest + + + + twitter + + + + facebook + + + + instagram + + + + vimeo + + + + whatsapp + + + + Bookmark + + + + + + + + + Entries + + + + + + + BURGER NEW + + + + + + + + + + + + + + Chevron Down + + + + + + + + + + + Chevron Left + + + + + + + + Chevron Right + + + + + + + + + Basket + + + + + + + + + + + Speech + + + + + + + + + Comment + + + + + + + + + Search + + + + + + + + + + + Video Play Icon + + + + + + + + + + + + + Premium + Nigella Lawson + + + + + + + + + + + + + + Vegan + + + + + + + + + + + + + Vegetarian + + + + + + + + + + + + + + + + + + + Member + + + + + + + + + + + Speech + + + + + + + + + Recipe + + + + + + + + + + + + + Email + + + + + + + + + + + + + Bookmark + + + + + + + + + + + + + Comment + + + + + + + + + + + + + Camera + + + + + + + + + + + + + + Scales + + + + + + + + + + + + + Quantity + + + + + + + + + + + + + List + + + + + + + + + + + + + Reorder + + + + + + + + + Remove + + + + + + + Open book + + + + + + + + +
+ + +
+
+
+ + + + Menu + + + + + + + + + + + + Signed In + + +
+
+ + +
+
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+ More Guest recipes + Recipe search +

Coffee Baklava With Dried Figs

+
by , featured in Peináo: A Greek Feast for All
+
Published by Smith Street Books
+
    +
  • +
+
+
+
+
+ Print me +
+
+

Introduction

+
+

We know what you’re thinking, this isn’t your traditional baklava, but who doesn’t love dried figs? The figs give this baklava a natural sweetness, but if you don’t have any, simply replace them with the same amount of extra nuts.

+
+
+

We know what you’re thinking, this isn’t your traditional baklava, but who doesn’t love dried figs? The figs give this baklava a natural sweetness, but if you don’t have any, simply replace them with the same amount of extra nuts.

+
+ +
+
+
+ Image of Helena and Vikki Moursellas's Coffee Baklava with Dried Figs +
+
Photo by Jorge Rivera
+
+
+ +
+
+
+
+
+ +
+
+
+
+

Ingredients

+

Makes: 24

+
+ Metric + + Cups +
+
+
+
+
    +
  • 150 grams shelled pistachios (toasted, plus extra to serve)
  • +
  • 200 grams walnuts (toasted)
  • +
  • 100 grams soft dried figs (finely chopped)
  • +
  • 1 teaspoon ground cinnamon
  • +
  • 80 grams caster sugar
  • +
  • 375 grams filo pastry
  • +
  • 150 grams unsalted butter (melted)
  • +
+
+
+

GREEK COFFEE HONEY SYRUP

+
    +
  • 2 tablespoons Oasis Greek coffee or other Greek or Turkish finely ground coffee
  • +
  • 175 grams honey
  • +
  • 230 grams caster sugar
  • +
+
+
+
    + +
  • 1 cup shelled pistachios (toasted, plus extra to serve)
  • + +
  • 2 cups walnuts (toasted)
  • + +
  • 3½ ounces soft dried figs (finely chopped)
  • + +
  • 1 teaspoon ground cinnamon
  • + +
  • ⅓ cup superfine sugar
  • + +
  • 13 ounces filo pastry
  • + +
  • 5½ ounces unsalted butter (melted)
  • +
+
+
+

GREEK COFFEE HONEY SYRUP

+
    + +
  • 2 tablespoons Oasis Greek coffee or other Greek or Turkish finely ground coffee
  • + +
  • ½ cup honey
  • + +
  • 1 cup superfine sugar
  • +
+
+
+
+
+

Method

+

Coffee Baklava With Dried Figs is a guest recipe by Helena and Vikki Moursellas so we are not able to answer questions regarding this recipe

+
+
    +
  1. For the Greek coffee honey syrup, combine the ingredients and 150 ml (5 fl oz) of water in a small saucepan over high heat. Bring to a simmer, then reduce the heat to medium and cook, stirring occasionally, for 8–10 minutes, until the sugar dissolves. Set aside to cool.
  2. +
  3. Preheat the oven to 180°C (350°F). Grease the base and sides of a 20 cm × 30 cm (8 in × 12 in) baking tin and line with baking paper.
  4. +
  5. Pulse the nuts in a food processor until finely chopped (take care not to overprocess the nuts, otherwise you’ll end up with nut paste). Transfer the nuts to a bowl and stir through the fig, cinnamon and sugar.
  6. +
  7. Carefully lay the filo pastry sheets on a chopping board and trim the sheets to fit the size of the prepared pan or tin. Discard any pastry offcuts. Cover the filo pastry with a clean, slightly damp tea towel, to prevent the sheets from drying out.
  8. +
  9. Brush one filo pastry sheet with butter, then place in the prepared tin. Repeat with another seven sheets of filo pastry, buttering each layer. Scatter over one-third of the nut mixture and top with another four filo sheets, brushing each layer with butter. Repeat this process twice more. Gently press the final filo layer to compress the baklava slightly. Brush generously with the remaining butter.
  10. +
  11. Using a small sharp knife, score the top filo layer into 24 squares. Bake for 25–30 minutes, until the pastry is golden and crispy.
  12. +
  13. Pour the cooled coffee honey syrup over the hot baklava and stand for 1 hour or until the baklava is cool. Using a sharp knife, cut the baklava into pieces along the score marks and serve.
  14. +
+
+
+
    +
  1. For the Greek coffee honey syrup, combine the ingredients and 150 ml (5 fl oz) of water in a small saucepan over high heat. Bring to a simmer, then reduce the heat to medium and cook, stirring occasionally, for 8–10 minutes, until the sugar dissolves. Set aside to cool.
  2. +
  3. Preheat the oven to 180°C (350°F). Grease the base and sides of a 20 cm × 30 cm (8 in × 12 in) baking tin and line with baking paper.
  4. +
  5. Pulse the nuts in a food processor until finely chopped (take care not to overprocess the nuts, otherwise you’ll end up with nut paste). Transfer the nuts to a bowl and stir through the fig, cinnamon and sugar.
  6. +
  7. Carefully lay the filo pastry sheets on a chopping board and trim the sheets to fit the size of the prepared pan or tin. Discard any pastry offcuts. Cover the filo pastry with a clean, slightly damp tea towel, to prevent the sheets from drying out.
  8. +
  9. Brush one filo pastry sheet with butter, then place in the prepared tin. Repeat with another seven sheets of filo pastry, buttering each layer. Scatter over one-third of the nut mixture and top with another four filo sheets, brushing each layer with butter. Repeat this process twice more. Gently press the final filo layer to compress the baklava slightly. Brush generously with the remaining butter.
  10. +
  11. Using a small sharp knife, score the top filo layer into 24 squares. Bake for 25–30 minutes, until the pastry is golden and crispy.
  12. +
  13. Pour the cooled coffee honey syrup over the hot baklava and stand for 1 hour or until the baklava is cool. Using a sharp knife, cut the baklava into pieces along the score marks and serve.
  14. +
+
+
+
+
+

Additional Information

+
+

Leftover baklava will keep in an airtight container in the fridge for up to 1 week.

+

PREP IS YOUR BEST FRIEND:
+ Baklava is a great dessert to make the day before.

+
+
+

Leftover baklava will keep in an airtight container in the fridge for up to 1 week.

+

PREP IS YOUR BEST FRIEND:
+ Baklava is a great dessert to make the day before.

+
+
+
+
+
+ +
+
+ +
+
+
+ +
+ +
+

Tell us what you think

+ + +
+ +
+ + +
+ +
+
+
+
+
+
+
+ Venison Steak Salad +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ + + + + +
+
+
+ +
+ + + +
+
+
+
+
+
+ + + + + + + + \ No newline at end of file