From 0a42229fb020602d24163d18d8a3540c8e4116b5 Mon Sep 17 00:00:00 2001 From: Brett Eisenberg Date: Fri, 25 Nov 2022 19:15:16 -0800 Subject: [PATCH] add sunset.com --- README.rst | 1 + recipe_scrapers/__init__.py | 2 + recipe_scrapers/sunset.py | 29 + tests/test_data/sunset.testhtml | 1002 +++++++++++++++++++++++++++++++ tests/test_sunset.py | 59 ++ 5 files changed, 1093 insertions(+) create mode 100644 recipe_scrapers/sunset.py create mode 100644 tests/test_data/sunset.testhtml create mode 100644 tests/test_sunset.py diff --git a/README.rst b/README.rst index b124b33ee..42f39c898 100644 --- a/README.rst +++ b/README.rst @@ -271,6 +271,7 @@ Scrapers available for: - `https://streetkitchen.hu/ `_ - `https://sunbasket.com/ `_ - `https://sundpaabudget.dk/ `_ +- `https://www.sunset.com/ `_ - `https://sweetcsdesigns.com/ `_ - `https://sweetpeasandsaffron.com/ `_ - `https://tasteofhome.com `_ diff --git a/recipe_scrapers/__init__.py b/recipe_scrapers/__init__.py index 153da1dbd..7214527aa 100644 --- a/recipe_scrapers/__init__.py +++ b/recipe_scrapers/__init__.py @@ -187,6 +187,7 @@ from .streetkitchen import StreetKitchen from .sunbasket import SunBasket from .sundpaabudget import SundPaaBudget +from .sunset import Sunset from .sweetcsdesigns import SweetCsDesigns from .sweetpeasandsaffron import SweetPeasAndSaffron from .tasteofhome import TasteOfHome @@ -422,6 +423,7 @@ StreetKitchen.host(): StreetKitchen, SunBasket.host(): SunBasket, SundPaaBudget.host(): SundPaaBudget, + Sunset.host(): Sunset, SweetCsDesigns.host(): SweetCsDesigns, SweetPeasAndSaffron.host(): SweetPeasAndSaffron, TasteOfHome.host(): TasteOfHome, diff --git a/recipe_scrapers/sunset.py b/recipe_scrapers/sunset.py new file mode 100644 index 000000000..ad8318434 --- /dev/null +++ b/recipe_scrapers/sunset.py @@ -0,0 +1,29 @@ +# mypy: disallow_untyped_defs=False +from ._abstract import AbstractScraper + + +class Sunset(AbstractScraper): + @classmethod + def host(cls): + return "sunset.com" + + def title(self): + return self.schema.title() + + def total_time(self): + return self.schema.total_time() + + def yields(self): + return self.schema.yields() + + def image(self): + return self.schema.image() + + def ingredients(self): + return self.schema.ingredients() + + def instructions(self): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/tests/test_data/sunset.testhtml b/tests/test_data/sunset.testhtml new file mode 100644 index 000000000..6e85c4452 --- /dev/null +++ b/tests/test_data/sunset.testhtml @@ -0,0 +1,1002 @@ + + + + + + + + + Crisp-Top Sourdough Stuffing Recipe -Sunset Magazine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+ su-Crisp Top Sourdough Stuffing Image + + +

Photo: Romulo Yanes; Styling: Claire Spollen

+
+
+ + + + Yields + Serves 10 to 12 + + + + + Total Time + 1 hr 30 mins
+
AuthorAngela Brassinga
+
+

Although it's nearly as quick to make as boxed stuffing, this homemade version--soft in the middle and a little crunchy on the top--is prettier and certainly tastier.

+
+
+ +
+
+

How to Make It

+
Step 1
1

Slice bread into 1 1/2-in.-thick slices and tear into irregular 1- to 2-in. pieces. Spread on a rimmed baking sheet and leave to dry at room temperature until needed (up to 2 days). For the best stuffing, the bread should be very dry.

+
Step 2
2

Preheat oven to 350°. Melt butter in a large frying pan over medium heat. Pour out 2 tbsp. butter and set aside.

+
Step 3
3

Add onion, celery, herbs, and 1/2 tsp. each salt and pepper to hot pan. Cook until onions are translucent and celery is tender-crisp, about 15 minutes. Transfer to a large bowl.

+
Step 4
4

Add torn bread and broth to vegetables and mix in until bread is soaked. Add salt and pepper to taste.

+
Step 5
5

Generously coat a 9- by 13-in. glass baking pan with 1 tsp. reserved melted butter. Pour stuffing into pan and drizzle with remaining melted butter.

+
Step 6
6

Cover with foil; bake 25 minutes. Remove foil and bake until starting to brown on top, about 30 minutes more.

+
Step 7
7

Make ahead: Up to 2 days, chilled. Reheat at 350°, covered, until hot (about 30 minutes). Remove foil and cook 10 more minutes for a crunchy top layer.

+
Step 8
8

VARIATIONS

+
Step 9
9

Crisp-Top Sourdough Stuffing with Sausage and Greens: Add 8 oz. sautéed crumbled Italian ­sausage and 1 lb. briefly sautéed fresh spinach leaves to stuffing before baking.

+
Step 10
10

Scandinavian Stuffing: Replace sourdough with a 1-lb. loaf of crusty rye bread, then add 1 cup chopped fresh dill and 8 oz. diced smoked pork chops to stuffing before baking. Top with 2 tbsp. fresh dill sprigs before serving.

+
+
+
+
+

Ingredients

 1 1-pound loaf sourdough, at least 1 day old
 1/4 cup salted butter
 2 cups chopped onion (1 large)
 1 cup chopped celery (2 or 3 stalks)
 1/4 cup chopped flat-leaf parsley
 1 tablespoon finely chopped fresh sage
  About 1/2 tsp. kosher salt
  About 1/2 tsp. pepper
  About 3 cups turkey broth, reduced-sodium chicken broth, or mushroom or other vegetable broth

Directions

Step 1
1

Slice bread into 1 1/2-in.-thick slices and tear into irregular 1- to 2-in. pieces. Spread on a rimmed baking sheet and leave to dry at room temperature until needed (up to 2 days). For the best stuffing, the bread should be very dry.

+
Step 2
2

Preheat oven to 350°. Melt butter in a large frying pan over medium heat. Pour out 2 tbsp. butter and set aside.

+
Step 3
3

Add onion, celery, herbs, and 1/2 tsp. each salt and pepper to hot pan. Cook until onions are translucent and celery is tender-crisp, about 15 minutes. Transfer to a large bowl.

+
Step 4
4

Add torn bread and broth to vegetables and mix in until bread is soaked. Add salt and pepper to taste.

+
Step 5
5

Generously coat a 9- by 13-in. glass baking pan with 1 tsp. reserved melted butter. Pour stuffing into pan and drizzle with remaining melted butter.

+
Step 6
6

Cover with foil; bake 25 minutes. Remove foil and bake until starting to brown on top, about 30 minutes more.

+
Step 7
7

Make ahead: Up to 2 days, chilled. Reheat at 350°, covered, until hot (about 30 minutes). Remove foil and cook 10 more minutes for a crunchy top layer.

+
Step 8
8

VARIATIONS

+
Step 9
9

Crisp-Top Sourdough Stuffing with Sausage and Greens: Add 8 oz. sautéed crumbled Italian ­sausage and 1 lb. briefly sautéed fresh spinach leaves to stuffing before baking.

+
Step 10
10

Scandinavian Stuffing: Replace sourdough with a 1-lb. loaf of crusty rye bread, then add 1 cup chopped fresh dill and 8 oz. diced smoked pork chops to stuffing before baking. Top with 2 tbsp. fresh dill sprigs before serving.

+
Crisp-Top Sourdough Stuffing

Search All of Sunset's Recipes

+ +
+
+ +
+
+
+
+
+
+ + + + + + + + +
+
+ + + + + +
+ + + + + + diff --git a/tests/test_sunset.py b/tests/test_sunset.py new file mode 100644 index 000000000..fe1a76f13 --- /dev/null +++ b/tests/test_sunset.py @@ -0,0 +1,59 @@ +from recipe_scrapers.sunset import Sunset +from tests import ScraperTest + + +class TestSunsetScraper(ScraperTest): + + scraper_class = Sunset + + def test_host(self): + self.assertEqual("sunset.com", self.harvester_class.host()) + + def test_canonical_url(self): + self.assertEqual( + "https://www.sunset.com/recipe/crisp-top-sourdough-stuffing", + self.harvester_class.canonical_url(), + ) + + def test_title(self): + self.assertEqual( + self.harvester_class.title(), + "Crisp-Top Sourdough Stuffing", + ) + + def test_author(self): + self.assertEqual(self.harvester_class.author(), "Angela Brassinga") + + def test_total_time(self): + self.assertEqual(90, self.harvester_class.total_time()) + + def test_yields(self): + self.assertEqual("12 servings", self.harvester_class.yields()) + + def test_image(self): + self.assertEqual( + "https://img.sunset02.com/sites/default/files/styles/4_3_horizontal_-_900x675/public/crisp-top-sourdough-stuffing-su.jpg", + self.harvester_class.image(), + ) + + def test_ingredients(self): + self.assertEqual( + [ + "1 1-pound loaf sourdough, at least 1 day old", + "1/4 cup salted butter", + "2 cups chopped onion (1 large)", + "1 cup chopped celery (2 or 3 stalks)", + "1/4 cup chopped flat-leaf parsley", + "1 tablespoon finely chopped fresh sage", + "About 1/2 tsp. kosher salt", + "About 1/2 tsp. pepper", + "About 3 cups turkey broth, reduced-sodium chicken broth, or mushroom or other vegetable broth", + ], + self.harvester_class.ingredients(), + ) + + def test_instructions(self): + return self.assertEqual( + "Step 1\n Slice bread into 1 1/2-in.-thick slices and tear into irregular 1- to 2-in. pieces. Spread on a rimmed baking sheet and leave to dry at room temperature until needed (up to 2 days). For the best stuffing, the bread should be very dry.\nStep 2\n Preheat oven to 350°. Melt butter in a large frying pan over medium heat. Pour out 2 tbsp. butter and set aside.\nStep 3\n Add onion, celery, herbs, and 1/2 tsp. each salt and pepper to hot pan. Cook until onions are translucent and celery is tender-crisp, about 15 minutes. Transfer to a large bowl.\nStep 4\n Add torn bread and broth to vegetables and mix in until bread is soaked. Add salt and pepper to taste.\nStep 5\n Generously coat a 9- by 13-in. glass baking pan with 1 tsp. reserved melted butter. Pour stuffing into pan and drizzle with remaining melted butter.\nStep 6\n Cover with foil; bake 25 minutes. Remove foil and bake until starting to brown on top, about 30 minutes more.\nStep 7\nMake ahead: Up to 2 days, chilled. Reheat at 350°, covered, until hot (about 30 minutes). Remove foil and cook 10 more minutes for a crunchy top layer.\nStep 8\nVARIATIONS\nStep 9\nCrisp-Top Sourdough Stuffing with Sausage and Greens: Add 8 oz. sautéed crumbled Italian \xadsausage and 1 lb. briefly sautéed fresh spinach leaves to stuffing before baking.\nStep 10\nScandinavian Stuffing: Replace sourdough with a 1-lb. loaf of crusty rye bread, then add 1 cup chopped fresh dill and 8 oz. diced smoked pork chops to stuffing before baking. Top with 2 tbsp. fresh dill sprigs before serving.", + self.harvester_class.instructions(), + )