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 amessavorykitchen #1390

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -102,6 +102,7 @@ Scrapers available for:
- `https://altonbrown.com/ <https://altonbrown.com/>`_
- `https://amazingribs.com/ <https://amazingribs.com/>`_
- `https://ambitiouskitchen.com/ <https://ambitiouskitchen.com>`_
- `https://ameessavorydish.com/ <https://ameessavorydish.com/>`_
- `https://americastestkitchen.com/ <https://www.americastestkitchen.com>`_ (*)
- `https://archanaskitchen.com/ <https://archanaskitchen.com/>`_
- `https://www.argiro.gr/ <https://www.argiro.gr/>`_
Expand Down
2 changes: 2 additions & 0 deletions recipe_scrapers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
from .amazingribs import AmazingRibs
from .ambitiouskitchen import AmbitiousKitchen
from .americastestkitchen import AmericasTestKitchen
from .amessavorydish import AmesSavoryDish
from .archanaskitchen import ArchanasKitchen
from .argiro import Argiro
from .arla import Arla
Expand Down Expand Up @@ -446,6 +447,7 @@
AmazingRibs.host(): AmazingRibs,
AmbitiousKitchen.host(): AmbitiousKitchen,
AmericasTestKitchen.host(): AmericasTestKitchen,
AmesSavoryDish.host(): AmesSavoryDish,
ArchanasKitchen.host(): ArchanasKitchen,
Argiro.host(): Argiro,
Arla.host(): Arla,
Expand Down
46 changes: 46 additions & 0 deletions recipe_scrapers/amessavorydish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from ._abstract import AbstractScraper
from ._grouping_utils import group_ingredients
from ._utils import get_equipment, normalize_string


class AmesSavoryDish(AbstractScraper):
@classmethod
def host(cls):
return "ameessavorydish.com"

def ingredients(self):
ingredients_list = []
for element in self.soup.select(".wprm-recipe-ingredient:not(:has(strong))"):
ingredient_text = " ".join(
span.get_text(strip=True)
for span in element.select(
".wprm-recipe-ingredient-amount, "
".wprm-recipe-ingredient-unit, "
".wprm-recipe-ingredient-name, "
".wprm-recipe-ingredient-notes"
)
)
ingredients_list.append(ingredient_text)
return ingredients_list

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-ingredient-group .wprm-recipe-ingredient-name strong",
".wprm-recipe-ingredient:not(:has(strong))",
)

def equipment(self):
equipment_container = self.soup.find(
"div", class_="wprm-recipe-equipment-container"
)
if not equipment_container:
return None
equipment_items = [
normalize_string(item.get_text())
for item in equipment_container.find_all(
"div", class_="wprm-recipe-equipment-name"
)
]
return get_equipment(equipment_items)
63 changes: 63 additions & 0 deletions tests/test_data/ameessavorydish.com/amessavorydish_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"author": "Amee Livingston",
"canonical_url": "https://ameessavorydish.com/pumpkin-chocolate-cake/",
"site_name": "Amee's Savory Dish",
"host": "ameessavorydish.com",
"language": "en-US",
"title": "Gluten-Free Pumpkin Chocolate Cake",
"ingredients": [
"1 cup King Arthur measure for measure all-purpose gluten-free flour sifted. You can also use cake flour if gluten is not a concern.",
"1/3 cup cocoa powder",
"1 1/2 teaspoons cinnamon",
"1/2 tsp pumpkin pie spice",
"1 teaspoon baking powder",
"1/2 teaspoon baking soda",
"1/4 teaspoon salt",
"1/4 cup butter melted",
"3/4 cup coconut sugar *see notes for sweetener swaps",
"1/4 cup pure maple syrup room temperature",
"2 eggs room temperature",
"1/4 cup Kefir plain unsweetened (or buttermilk)",
"15 oz can pumpkin purée",
"1 teaspoon vanilla extract",
"Powdered sugar for dusting (optional)"
],
"instructions_list": [
"Preheat oven to 350°F. Grease an (8-inch) square baking pan with butter or cooking oil spray and set aside.",
"In a large bowl, whisk together flour, cocoa powder, cinnamon, pumpkin pie spice, baking powder, baking soda and salt.",
"In a separate bowl, whisk together melted butter, coconut sugar, maple syrup, kefir, eggs, pumpkin and vanilla.",
"Whisk flour mixture into pumpkin mixture until well combined then transfer batter to prepared pan. Bake 40-50 minutes or until the cakes pulls away from the sides of the pan and a toothpick or cake tester inserted in the center comes out clean.",
"Set aside to let cool then cut into squares and dust with powdered sugar, or top with whipped cream or frosting."
],
"category": "Dessert",
"yields": "12 servings",
"description": "This Gluten-free Pumpkin Chocolate Cake has the perfect balance of cocoa and pumpkin spice -and is nothing short of amazing!",
"total_time": 50,
"cook_time": 40,
"prep_time": 10,
"cuisine": "American",
"ratings": 4.72,
"ratings_count": 7,
"nutrients": {
"servingSize": "1 serving",
"calories": "151 kcal",
"fatContent": "5 g",
"saturatedFatContent": "1 g",
"unsaturatedFatContent": "3 g",
"transFatContent": "1 g",
"carbohydrateContent": "25 g",
"sugarContent": "12 g",
"proteinContent": "3 g",
"sodiumContent": "210 mg",
"fiberContent": "3 g",
"cholesterolContent": "28 mg"
},
"image": "https://ameessavorydish.com/wp-content/uploads/2017/11/Pumpkin-choc-cake-feature-.jpg",
"keywords": [
"cake",
"chocolate",
"fall",
"glutenfree",
"pumpkin"
]
}
1,490 changes: 1,490 additions & 0 deletions tests/test_data/ameessavorydish.com/amessavorydish_1.testhtml

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions tests/test_data/ameessavorydish.com/amessavorydish_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"author": "Amee Livingston",
"canonical_url": "https://ameessavorydish.com/roasted-vegetable-power-bowl-with-creamy-avocado-dressing-thereciperedux/",
"site_name": "Amee's Savory Dish",
"host": "ameessavorydish.com",
"language": "en-US",
"title": "Taco Bell Veggie Power Bowl {Copycat Recipe}",
"ingredients": [
"1 cup canned black beans in seasoned sauce",
"1 cup Spanish style ready rice",
"4 cups lettuce finely chopped",
"2 Roma tomatoes seeded and chopped",
"2 oz cheddar cheese shredded-or try a three-cheese blend similar to the one Taco Bell uses, made with mozzarella, cheddar, and pepper jack cheese",
"½ avocado sliced",
"2 tbsp sour cream",
"½ ripe avocado",
"½ cup plain non-fat Greek yogurt",
"3 tbsp fresh lime juice",
"1 tbsp ranch seasoning *in the packet",
"Optional bowl add-ins: onions, pickled jalapeños, salsa, pico de gallo"
],
"ingredient_groups": [
{
"ingredients": [
"1 cup canned black beans in seasoned sauce",
"1 cup Spanish style ready rice",
"4 cups lettuce finely chopped",
"2 Roma tomatoes seeded and chopped",
"2 oz cheddar cheese shredded-or try a three-cheese blend similar to the one Taco Bell uses, made with mozzarella, cheddar, and pepper jack cheese",
"½ avocado sliced",
"2 tbsp sour cream"
],
"purpose": "For the bowls:"
},
{
"ingredients": [
"½ ripe avocado",
"½ cup plain non-fat Greek yogurt",
"3 tbsp fresh lime juice",
"1 tbsp ranch seasoning *in the packet",
"Optional bowl add-ins: onions, pickled jalapeños, salsa, pico de gallo"
],
"purpose": "For the avocado lime ranch dressing:"
}
],
"instructions_list": [
"Place the black beans in a small saucepan and heat on medium-low. Heat beans until simmering, while stirring.",
"While the beans are simmering, cook the seasoned rice in the microwave according to package directions, typically 90 seconds.",
"Divide the ingredients between 2 medium-size bowls.",
"Place the dressing ingredients into a small blender or food processor and blend until smooth.",
"Drizzle the dressing on top of the bowls and serve."
],
"category": "Main Course",
"yields": "2 servings",
"description": "An easy Mexican-inspired vegetable power bowl recipe ready in 10 minutes or less.",
"total_time": 10,
"cook_time": 5,
"prep_time": 5,
"cuisine": "Mexican",
"equipment": [
"Microwave",
"small saucepan"
],
"nutrients": {
"servingSize": "1 serving",
"calories": "484 kcal",
"fatContent": "21 g",
"saturatedFatContent": "7 g",
"unsaturatedFatContent": "11 g",
"transFatContent": "0.01 g",
"carbohydrateContent": "55 g",
"sugarContent": "8 g",
"proteinContent": "22 g",
"sodiumContent": "1343 mg",
"fiberContent": "12 g",
"cholesterolContent": "35 mg"
},
"image": "https://ameessavorydish.com/wp-content/uploads/2016/10/Veggie-taco-bowl-feature.jpg",
"keywords": [
"beans",
"rice",
"vegetables"
]
}
Loading
Loading