From faf354bd5735533cf9d5fb98d22785eed8c71b4a Mon Sep 17 00:00:00 2001 From: carl anderson <39501603+weightwatchers-carlanderson@users.noreply.github.com> Date: Tue, 16 Feb 2021 21:23:52 -0500 Subject: [PATCH] New Site: MarthaStewart.com (#319) * initial commit * adding marthastewart * running black on files * removing dupe import * black on test file Co-authored-by: Carl Anderson --- README.rst | 1 + recipe_scrapers/__init__.py | 2 + recipe_scrapers/marthastewart.py | 35 + tests/test_data/marthastewart.testhtml | 5713 ++++++++++++++++++++++++ tests/test_marthastewart.py | 61 + 5 files changed, 5812 insertions(+) create mode 100644 recipe_scrapers/marthastewart.py create mode 100644 tests/test_data/marthastewart.testhtml create mode 100644 tests/test_marthastewart.py diff --git a/README.rst b/README.rst index bbfd24b6f..0dcb7c7c4 100644 --- a/README.rst +++ b/README.rst @@ -139,6 +139,7 @@ Scrapers available for: - `https://lecremedelacrumb.com/ `_ - `https://marmiton.org/ `_ - `https://matprat.no/ `_ +- `https://www.marthastewart.com/ `_ - `https://www.melskitchencafe.com/ `_ - `http://mindmegette.hu/ `_ - `https://minimalistbaker.com/ `_ diff --git a/recipe_scrapers/__init__.py b/recipe_scrapers/__init__.py index 97e752c8f..496da0ab8 100644 --- a/recipe_scrapers/__init__.py +++ b/recipe_scrapers/__init__.py @@ -76,6 +76,7 @@ from .lecremedelacrumb import LeCremeDeLaCrumb from .lovingitvegan import Lovingitvegan from .marmiton import Marmiton +from .marthastewart import MarthaStewart from .matprat import Matprat from .melskitchencafe import MelsKitchenCafe from .mindmegette import Mindmegette @@ -223,6 +224,7 @@ TheKitchn.host(): TheKitchn, TheNutritiousKitchen.host(): TheNutritiousKitchen, Marmiton.host(): Marmiton, + MarthaStewart.host(): MarthaStewart, Matprat.host(): Matprat, MelsKitchenCafe.host(): MelsKitchenCafe, Mindmegette.host(): Mindmegette, diff --git a/recipe_scrapers/marthastewart.py b/recipe_scrapers/marthastewart.py new file mode 100644 index 000000000..2c89ec8e3 --- /dev/null +++ b/recipe_scrapers/marthastewart.py @@ -0,0 +1,35 @@ +from ._abstract import AbstractScraper +from ._utils import get_minutes + + +class MarthaStewart(AbstractScraper): + @classmethod + def host(cls): + return "marthastewart.com" + + def title(self): + return self.schema.title() + + def total_time(self): + s = ( + self.soup.findAll("div", {"class": "two-subcol-content-wrapper"})[0] + .find("div", {"class": "recipe-meta-item-body"}) + .text.strip() + ) + return get_minutes(s) + + def yields(self): + return ( + self.soup.findAll("div", {"class": "two-subcol-content-wrapper"})[1] + .find("div", {"class": "recipe-meta-item-body"}) + .text.strip() + ) + + 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/marthastewart.testhtml b/tests/test_data/marthastewart.testhtml new file mode 100644 index 000000000..e44af3de2 --- /dev/null +++ b/tests/test_data/marthastewart.testhtml @@ -0,0 +1,5713 @@ + + + + + Breaded Chicken Breasts Recipe | Martha Stewart + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+ +
+ +
+
+
+ + + + + +
+
+ + + + Rating: 3.21 stars + + + + + + + + + + +
+
+ 291 Ratings +
    +
  • + 5 star values: + + + + + + 54 + +
  • +
  • + 4 star values: + + + + + + 48 + +
  • +
  • + 3 star values: + + + + + + 106 + +
  • +
  • + 2 star values: + + + + + + 70 + +
  • +
  • + 1 star values: + + + + + + 13 + +
  • +
+
+ +
+
+
+ +
+
+ +
+

Whenever you make breaded and fried chicken, it disappears almost immediately. Try our foolproof three-step method for perfect results every time, then turn it into Chicken Parmesan or serve over salad.

+
+ + + + + +
+ Everyday Food, March 2009 +
+
+ +
+ + +
+ +
+
+

Gallery

+
+ +
+ +
+ +
Read the full recipe after the video.
+
+ +
+ +
+ +
+

Recipe Summary

+ +
+
+
+
+ prep: +
+
+ 25 mins + + + +
+
+
+
+ total: +
+
+ 25 mins + + + +
+
+
+
+
+
+ Servings: +
+
+ 4 + + + +
+
+
+
+
+ + + +
+
+ +
+ + + +
+
+ + + + + + +
+ +
Advertisement
+ + + + + + + +
+
+
+

Ingredients

+
+
+ + Ingredient Checklist + +
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+ +
+ + +
+
+
+
+ + +
+

+ + Directions +

+ +
+ + Instructions Checklist + +
    +
  • + +
    +
    +

    In a shallow dish, whisk eggs with teaspoon salt; let stand 5 minutes. In another shallow dish, season flour with 1/4 teaspoon salt. In a third shallow dish, season breadcrumbs with 1 teaspoon salt.

    +
    +
    + + + +
    Advertisement
    +
  • +
  • + +
    +
    +

    In a large cast-iron skillet or other heavy deep skillet, heat oil over medium. Meanwhile, pat chicken dry with paper towels. Coat in flour, shaking off excess, then dip in egg (letting excess drip off). Dredge in breadcrumbs, turning twice and patting to adhere.

    +
    +
    +
  • +
  • + +
    +
    +

    Increase heat to medium-high. Working in batches, add chicken to skillet; cook, gently shaking skillet occasionally, until chicken is browned, about 4 minutes. Turn with tongs; cook until browned and opaque throughout, 2 to 3 minutes more (if browning too quickly, lower heat). Between batches, skim off brown crumbs from oil with a slotted spoon. Drain chicken on paper towels; season with salt.

    +
    +
    +
  • +
+
+ +
+ +
+
+

Cook's Notes +

+ + + + + + +

Making breadcrumbs: For 3 1/2 cups, pulse 9 slices white bread in a food processor until fine crumbs form.

+ +
+
+ + + + +
+ +
+
+ + +
+ +
+ +
+ +
+
+ + + + + + +
+
Advertisement
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+ + +
+ +
+
+

+ + Reviews + (8) +

+
+
+
+
+
+ +
+
+
+
+ 291 Ratings +
    +
  • + 5 star values: + + + + + + 54 + +
  • +
  • + 4 star values: + + + + + + 48 + +
  • +
  • + 3 star values: + + + + + + 106 + +
  • +
  • + 2 star values: + + + + + + 70 + +
  • +
  • + 1 star values: + + + + + + 13 + +
  • +
+
+
+
+
+
+
+
+ +
+
+
+ + Rating: 5 stars + + + + + + + +
+
+ 03/22/2019 +
+
+ + + This recipe and demo make it look perfectly easy! + +
+
+
+ +
+
+
+ + Rating: 5 stars + + + + + + + +
+
+ 09/14/2018 +
+
+ + + I subbed panko and I thought they were great! + +
+
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 03/05/2011 +
+
+ + + I'm glad I read your comments. I agree there looks like a lot of salt so I will take + your advice and cut back. Bekagram + +
+
+
+
+
Advertisement
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 03/03/2011 +
+
+ + + What would be good to serve with this? + +
+
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 03/01/2011 +
+
+ + + I have made this many times, we are jewish and call this dish chicken shnitzel. I do agree with erasure though, it doesn't need all that salt. I have never added salt to the egg or the flour, just a little to the breadcrumbs along with other spices, and lately I've been baking it instead of frying for health reasons, and it is almost as tasty...almost, not quite. + +
+
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 03/01/2011 +
+
+ + + I find that some of the recipes here are too salty for my tastes too. I just use less. I bet a touch a parmesan cheese, instead of the salt, would be good as well as a few herbs. + +
+
+
+
+
Advertisement
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 03/01/2011 +
+
+ + + Why so much salt? I've made this recipe without any salt, and it's equally delicious. Try adding some herbs to the breadcrumbs, too! + +
+
+
+ +
+
+
+ + Rating: Unrated + + + + + + + +
+
+ 05/05/2010 +
+
+ + + This breading for chicken is delicious, although I needed less breadcrumbs and more flour. It is crispy and a treat to eat. + +
+
+
+
+
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + +
+
Advertisement
+ + + + + + + + + + + + +
+
+
+
+ + + + + + +
+
+ + + + diff --git a/tests/test_marthastewart.py b/tests/test_marthastewart.py new file mode 100644 index 000000000..2241310c7 --- /dev/null +++ b/tests/test_marthastewart.py @@ -0,0 +1,61 @@ +from recipe_scrapers.marthastewart import MarthaStewart +from tests import ScraperTest + + +class TestMarthaStewart(ScraperTest): + + scraper_class = MarthaStewart + + maxDiff = None + + def test_host(self): + self.assertEqual("marthastewart.com", self.harvester_class.host()) + + def test_canonical_url(self): + self.assertEqual( + "https://www.marthastewart.com/336792/breaded-chicken-breasts", + self.harvester_class.canonical_url(), + ) + + def test_title(self): + self.assertEqual(self.harvester_class.title(), "Breaded Chicken Breasts") + + def test_total_time(self): + self.assertEqual(25, self.harvester_class.total_time()) + + def test_yields(self): + self.assertEqual("4", self.harvester_class.yields()) + + def test_image(self): + self.assertEqual( + "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fassets.marthastewart.com%2Fstyles%2Fwmax-750%2Fd31%2Fbreaded-chicken-cutlets-d104370%2Fbreaded-chicken-cutlets-d104370_horiz.jpg%3Fitok%3DdnK5TccB", + self.harvester_class.image(), + ) + + def test_ingredients(self): + self.assertSetEqual( + set( + [ + "3 large eggs", + "Coarse salt", + "1/3 cup all-purpose flour", + "3 1/2 cups fresh breadcrumbs", + "1 cup vegetable oil", + "8 thin chicken cutlets (about 1 1/2 pounds total)", + "Lemon wedges, for serving (optional)", + ] + ), + set(self.harvester_class.ingredients()), + ) + + def test_instructions(self): + return self.assertEqual( + "\n".join( + [ + "In a shallow dish, whisk eggs with teaspoon salt; let stand 5 minutes. In another shallow dish, season flour with 1/4 teaspoon salt. In a third shallow dish, season breadcrumbs with 1 teaspoon salt.", + "In a large cast-iron skillet or other heavy deep skillet, heat oil over medium. Meanwhile, pat chicken dry with paper towels. Coat in flour, shaking off excess, then dip in egg (letting excess drip off). Dredge in breadcrumbs, turning twice and patting to adhere.", + "Increase heat to medium-high. Working in batches, add chicken to skillet; cook, gently shaking skillet occasionally, until chicken is browned, about 4 minutes. Turn with tongs; cook until browned and opaque throughout, 2 to 3 minutes more (if browning too quickly, lower heat). Between batches, skim off brown crumbs from oil with a slotted spoon. Drain chicken on paper towels; season with salt.", + ] + ), + self.harvester_class.instructions(), + )