-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scraper for 40aprons.com (#1408)
- Loading branch information
1 parent
5093d2b
commit e3c7ee9
Showing
7 changed files
with
4,859 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
|
||
|
||
class FortyAprons(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "40aprons.com" | ||
|
||
def author(self): | ||
return self.schema.author() | ||
|
||
def description(self): | ||
return self.schema.description() | ||
|
||
def image(self): | ||
return self.schema.image() | ||
|
||
def ingredients(self): | ||
return self.schema.ingredients() | ||
|
||
def instructions(self): | ||
return self.schema.instructions() | ||
|
||
def title(self): | ||
return self.schema.title() | ||
|
||
def total_time(self): | ||
return self.schema.total_time() | ||
|
||
def yields(self): | ||
return self.schema.yields() | ||
|
||
def category(self): | ||
return self.schema.category() | ||
|
||
def cook_time(self): | ||
return self.schema.cook_time() | ||
|
||
def cuisine(self): | ||
return self.schema.cuisine() | ||
|
||
def nutrients(self): | ||
return self.schema.nutrients() | ||
|
||
def prep_time(self): | ||
return self.schema.prep_time() | ||
|
||
def ratings(self): | ||
return self.schema.ratings() | ||
|
||
def ratings_count(self): | ||
return self.schema.ratings_count() | ||
|
||
def equipment(self): | ||
equipment_elements = self.soup.select(".wprm-recipe-equipment-name") | ||
return ( | ||
[element.get_text() for element in equipment_elements] | ||
if equipment_elements | ||
else None | ||
) | ||
|
||
def keywords(self): | ||
return self.schema.keywords() | ||
|
||
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
"h4.wprm-recipe-group-name", | ||
"li.wprm-recipe-ingredient", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"author": "Cheryl Malik", | ||
"canonical_url": "https://40aprons.com/rosemary-raspberry-vodka-fizz/", | ||
"site_name": "40 Aprons", | ||
"host": "40aprons.com", | ||
"language": "en-US", | ||
"title": "Raspberry Cocktails with Rosemary", | ||
"ingredients": [ | ||
"1 tablespoon rosemary needles", | ||
"1 ½ cups frozen raspberries (defrosted)", | ||
"juice of 1 lemon (approximately 2 tablespoons)", | ||
"5 tablespoons sugar (¼ cup + 1 tablespoon)", | ||
"¾ cup water", | ||
"1 tablespoon cornstarch", | ||
"1 ½ ounces vodka (or gin)", | ||
"½ ounce St. Germaine elderflower liqueur", | ||
"1 ½ ounces raspberry-rosemary syrup (made from ingredients above)", | ||
"ice", | ||
"1 tablespoon soda water", | ||
"1 tablespoon champagne", | ||
"ice", | ||
"rosemary sprigs", | ||
"raspberries" | ||
], | ||
"ingredient_groups": [ | ||
{ | ||
"ingredients": [ | ||
"1 tablespoon rosemary needles", | ||
"1 ½ cups frozen raspberries (defrosted)", | ||
"juice of 1 lemon (approximately 2 tablespoons)", | ||
"5 tablespoons sugar (¼ cup + 1 tablespoon)", | ||
"¾ cup water", | ||
"1 tablespoon cornstarch" | ||
], | ||
"purpose": "For the Raspberry-Rosemary Syrup (Makes Enough for 6–8 Cocktails)" | ||
}, | ||
{ | ||
"ingredients": [ | ||
"1 ½ ounces vodka (or gin)", | ||
"½ ounce St. Germaine elderflower liqueur", | ||
"1 ½ ounces raspberry-rosemary syrup (made from ingredients above)", | ||
"ice", | ||
"1 tablespoon soda water", | ||
"1 tablespoon champagne" | ||
], | ||
"purpose": "For the Cocktail (Makes Enough for 1 Cocktail)" | ||
}, | ||
{ | ||
"ingredients": [ | ||
"ice", | ||
"rosemary sprigs", | ||
"raspberries" | ||
], | ||
"purpose": "Serving Suggestions (All Optional)" | ||
} | ||
], | ||
"instructions_list": [ | ||
"For the Syrup (Makes Enough for 6-8 Cocktails)", | ||
"Add 1 tablespoon rosemary needles to small bowl. Muddle rosemary needles with muddler or back of wooden spoon to release oils.", | ||
"Place small saucepan on stovetop over high heat. Add muddled rosemary needles, 1 ½ cups frozen raspberries, juice of lemon, 5 tablespoons sugar, ¾ cup water, and 1 tablespoon cornstarch to saucepan. Stir to incorporate, then bring mixture to rolling boil.", | ||
"When mixture begins to boil, immediately reduce heat under saucepan to low.", | ||
"Use potato masher to mash raspberries completely, then stir mixture and simmer 10 minutes.", | ||
"After 10 minutes, remove saucepan from heat and set aside. Let mixture cool completely.", | ||
"Once cooled, pour mixture through fine-mesh strainer or nut-milk bag and into airtight container. Use immediately or refrigerate until ready to use.", | ||
"For the Cocktail (Makes Enough for 1 Cocktail)", | ||
"Add 1 ½ ounces vodka (or gin), ½ ounce St. Germaine elderflower liqueur, 1 ½ ounces raspberry-rosemary syrup, and ice to cocktail shaker. Shake vigorously.", | ||
"Strain cocktail into glass, with or without ice. Add 1 tablespoon soda water and stir to incorporate into drink. Top cocktail with 1 tablespoon champagnethen garnish with rosemary sprigs and raspberries if desired. Serve immediately." | ||
], | ||
"category": "Drinks", | ||
"yields": "1 serving", | ||
"description": "A flavorful, vibrant cocktail blending fruity raspberry, woodsy rosemary, floral St. Germaine, and bubbly champagne.", | ||
"total_time": 25, | ||
"cook_time": 15, | ||
"prep_time": 10, | ||
"cuisine": "American", | ||
"ratings": 5.0, | ||
"ratings_count": 1.0, | ||
"equipment": [ | ||
"Small bowl", | ||
"Muddler", | ||
"Small saucepan", | ||
"Potato masher", | ||
"Fine mesh sieve or nut-milk bag", | ||
"Cocktail shaker" | ||
], | ||
"nutrients": { | ||
"servingSize": "1 cocktail", | ||
"calories": "357 kcal", | ||
"fatContent": "1 g", | ||
"saturatedFatContent": "1 g", | ||
"unsaturatedFatContent": "2 g", | ||
"carbohydrateContent": "36 g", | ||
"sugarContent": "30 g", | ||
"proteinContent": "1 g", | ||
"sodiumContent": "18 mg", | ||
"fiberContent": "4 g" | ||
}, | ||
"image": "https://40aprons.com/wp-content/uploads/2015/12/raspberry-cocktails-rosemary-01.jpg", | ||
"keywords": [ | ||
"christmas dinner", | ||
"holiday drink", | ||
"winter flavors" | ||
] | ||
} |
Oops, something went wrong.