Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for natashaskitchen #1440

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ Scrapers available for:
- `https://www.myplate.gov/ <https://www.myplate.gov/>`_
- `https://myrecipes.com/ <https://myrecipes.com>`_
- `https://myvegetarianroots.com/ <https://myvegetarianroots.com/>`_
- `https://natashaskitchen.com/ <https://natashaskitchen.com/>`_
- `https://www.nhs.uk/healthier-families/ <https://www.nhs.uk/healthier-families/>`_
- `https://nibbledish.com/ <https://nibbledish.com>`_
- `https://noracooks.com/ <https://noracooks.com/>`_
Expand Down
2 changes: 2 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
from .mykoreankitchen import MyKoreanKitchen
from .myrecipes import MyRecipes
from .myvegetarianroots import MyVegetarianRoots
from .natashaskitchen import NatashasKitchen
from .nhshealthierfamilies import NHSHealthierFamilies
from .nibbledish import NibbleDish
from .nihhealthyeating import NIHHealthyEating
Expand Down Expand Up @@ -586,6 +587,7 @@
MyJewishLearning.host(): MyJewishLearning,
MyKoreanKitchen.host(): MyKoreanKitchen,
MyVegetarianRoots.host(): MyVegetarianRoots,
NatashasKitchen.host(): NatashasKitchen,
NoraCooks.host(): NoraCooks,
NotEnoughCinnamon.host(): NotEnoughCinnamon,
NutritionFacts.host(): NutritionFacts,
Expand Down
16 changes: 16 additions & 0 deletions recipe_scrapers/natashaskitchen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients


class NatashasKitchen(AbstractScraper):
@classmethod
def host(cls):
return "natashaskitchen.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group h4",
".wprm-recipe-ingredient",
)
50 changes: 50 additions & 0 deletions tests/test_data/natashaskitchen.com/natashaskitchen_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"author": "Natalya Drozhzhin",
"canonical_url": "https://natashaskitchen.com/sugar-cookies-recipe/",
"site_name": "NatashasKitchen.com",
"host": "natashaskitchen.com",
"language": "en-US",
"title": "Christmas Sugar Cookies Recipe",
"ingredients": [
"1 cup unsalted butter (softened at room temperature)",
"1 cup granulated sugar",
"1 egg (large)",
"1 tsp vanilla extract",
"3 cups all-purpose flour (measured correctly)",
"1 Tbsp baking powder",
"1/4 tsp salt"
],
"instructions_list": [
"Preheat oven to 350 °F with a rack in the center. Whisk together flour with baking powder and salt in a small bowl and set aside.",
"Using a stand-up or handheld mixer, beat the butter together with sugar. To the mixture add vanilla extract and egg and beat to combine.",
"To the butter mixture, add flour in 3 parts until fully incorporated.",
"Divide the dough into two equal parts. On a lightly floured surface, roll into ¼-inch thickness. Use a cookie cutter to cut out your favorite shapes.",
"Bake cookies on a parchment or silicone-lined baking sheet at 350˚F for 10 minutes, or until the edges are just beginning to turn golden.",
"Let the cookies cool for about 5 minutes on the baking sheet before moving them to a wire rack to cool completely and decorating with cookie icing."
],
"category": "Cookies,Dessert",
"yields": "40 servings",
"description": "Everyone needs an Easy Sugar Cookies Recipe! These are literally melt-in-your-mouth delicious. I am positive these Christmas cookies will win you over.",
"total_time": 30,
"cook_time": 10,
"prep_time": 20,
"cuisine": "American",
"ratings": 4.99,
"ratings_count": 575,
"nutrients": {
"servingSize": "1 serving",
"calories": "96 kcal",
"fatContent": "5 g",
"saturatedFatContent": "3 g",
"carbohydrateContent": "12 g",
"sugarContent": "5 g",
"proteinContent": "1 g",
"sodiumContent": "17 mg",
"fiberContent": "1 g",
"cholesterolContent": "16 mg"
},
"image": "https://natashaskitchen.com/wp-content/uploads/2019/12/Sugar-Cookies-8.jpg",
"keywords": [
"sugar cookies"
]
}
1,563 changes: 1,563 additions & 0 deletions tests/test_data/natashaskitchen.com/natashaskitchen_1.testhtml

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions tests/test_data/natashaskitchen.com/natashaskitchen_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"author": "Natasha Kravchuk",
"canonical_url": "https://natashaskitchen.com/cranberry-bread/",
"site_name": "NatashasKitchen.com",
"host": "natashaskitchen.com",
"language": "en-US",
"title": "Cranberry Bread with Orange Glaze",
"ingredients": [
"1 1/2 cups all-purpose flour",
"1 tsp baking powder",
"1/4 tsp salt",
"1/4 cup milk (room temperature)",
"Zest of 1 large orange (divided)",
"1/4 cup orange juice (freshly squeezed)",
"6 Tbsp unsalted butter (softened)",
"3/4 cup granulated sugar",
"2 large eggs (room temperature)",
"1 1/2 cups fresh cranberries (rinsed and patted dry)",
"1/2 Tbsp all-purpose flour",
"1 cup powdered sugar",
"1 1/2 Tbsp freshly squeezed orange juice (or to reach desired consistency)",
"1 tsp orange zest (reserved from the orange above)"
],
"ingredient_groups": [
{
"ingredients": [
"1 1/2 cups all-purpose flour",
"1 tsp baking powder",
"1/4 tsp salt",
"1/4 cup milk (room temperature)",
"Zest of 1 large orange (divided)",
"1/4 cup orange juice (freshly squeezed)",
"6 Tbsp unsalted butter (softened)",
"3/4 cup granulated sugar",
"2 large eggs (room temperature)",
"1 1/2 cups fresh cranberries (rinsed and patted dry)",
"1/2 Tbsp all-purpose flour"
],
"purpose": "Cranberry Bread Ingredients"
},
{
"ingredients": [
"1 cup powdered sugar",
"1 1/2 Tbsp freshly squeezed orange juice (or to reach desired consistency)",
"1 tsp orange zest (reserved from the orange above)"
],
"purpose": "Orange Glaze Ingredients:"
}
],
"instructions_list": [
"How to Make Cranberry Orange Bread:",
"Prep: Preheat oven to 350˚F. Butter a 6 cup (8 1/2 by 4 1/2 bread loaf pan) then dust with flour, tapping out the excess flour.",
"In a medium mixing bowl, whisk together: flour, baking powder, and salt. Set aside.",
"In a measuring cup, combine together milk, zest of 1 orange (Reserve 1 tsp zest for the glaze), and orange juice. Set aside.",
"In a large mixing bowl, cream together butter and granulated sugar on medium/high speed (2-3 minutes on high speed). It won’t be smooth, just combined. Beat in 2 large eggs, mixing until well incorporated.",
"Add flour mixture in 2 parts, alternating with the milk mixture and mixing on medium/low speed just until incorporated with each addition. Scrape the sides of the bowl with a spatula as needed.",
"Toss cranberries with 1/2 Tbsp flour then fold them into the batter just until incorporated. Spread the batter into your prepared pan and bake for 45-50 min at 350˚F until golden on top and a toothpick inserted into the center comes out clean. Let cool in pan 10-15 minutes then run a cake release tool or knife around the edges and transfer the loaf to a wire rack to cool completely before glazing.",
"To Make the Glaze:",
"In a separate bowl, stir together powdered sugar, orange juice and reserved teaspoon of zest. Stir until smooth. It should have a drizzling consistency. Add more orange juice to thin it out or powdered sugar to make it thicker."
],
"category": "Breakfast,Dessert",
"yields": "8 servings",
"description": "Orange Glazed Cranberry bread is loaded with juicy cranberries with a moist and tender crumb. This stays moist for a few days after it’s made so it’s perfect as a homemade Christmas gift.",
"total_time": 60,
"cook_time": 50,
"prep_time": 10,
"cuisine": "American",
"ratings": 4.99,
"ratings_count": 867,
"nutrients": {
"servingSize": "1 serving",
"calories": "326 kcal",
"fatContent": "10 g",
"saturatedFatContent": "6 g",
"unsaturatedFatContent": "4 g",
"transFatContent": "1 g",
"carbohydrateContent": "56 g",
"sugarContent": "36 g",
"proteinContent": "4 g",
"sodiumContent": "95 mg",
"fiberContent": "2 g",
"cholesterolContent": "64 mg"
},
"image": "https://natashaskitchen.com/wp-content/uploads/2021/12/Cranberry-Bread-SQ.jpg",
"keywords": [
"Cranberry Bread",
"Cranberry Orange Bread",
"Orange Cranberry Bread"
]
}
1,979 changes: 1,979 additions & 0 deletions tests/test_data/natashaskitchen.com/natashaskitchen_2.testhtml

Large diffs are not rendered by default.