-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,858 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,79 @@ | ||
from ._abstract import AbstractScraper | ||
from ._utils import get_minutes, get_yields | ||
|
||
|
||
class DonalSkehan(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "donalskehan.com" | ||
|
||
def author(self): | ||
image_element = self.soup.find("img", class_="img-fluid") | ||
return image_element.get("alt") if image_element else "Donal Skehan" | ||
|
||
def site_name(self): | ||
return "Donal Skehan" | ||
|
||
def title(self): | ||
return self.soup.find("title").get_text() | ||
|
||
def category(self): | ||
return self.soup.find("h6", class_="catColour dk-label").get_text() | ||
|
||
def total_time(self): | ||
total_time_elements = self.soup.find_all("li", class_="list-inline-item mb-2") | ||
for element in total_time_elements: | ||
if element.find("img", alt="time"): | ||
return get_minutes(element.get_text()) | ||
return None | ||
|
||
def yields(self): | ||
yields_element = self.soup.find("li", class_="list-inline-item mb-2") | ||
return ( | ||
get_yields(yields_element.get_text()) | ||
if yields_element and "serves" in yields_element.get_text().lower() | ||
else None | ||
) | ||
|
||
def image(self): | ||
image_element = self.soup.find("img", class_="img-fluid shadow") | ||
return image_element["src"] | ||
|
||
def ingredients(self): | ||
ingredients_section = self.soup.find( | ||
"div", class_="tab-pane fade show active", id="metric" | ||
) | ||
return [ | ||
ingredient.get_text().strip() | ||
for ingredient in ingredients_section.find_all("p") | ||
] | ||
|
||
def instructions(self): | ||
instructions_section = self.soup.find( | ||
"div", class_="recipe steps container-fluid" | ||
) | ||
return "\n".join( | ||
step.get_text().strip() | ||
for step in instructions_section.find_all("li", class_="list-group-item") | ||
) | ||
|
||
def keywords(self): | ||
keywords_section = self.soup.find("ul", id="tag") | ||
return [ | ||
keyword.get_text().strip() | ||
for keyword in keywords_section.find_all( | ||
"li", class_="list-inline-item mb-2" | ||
) | ||
] | ||
|
||
def equipment(self): | ||
equipment_section = self.soup.find("div", class_="need") | ||
return [ | ||
item.get_text().strip() | ||
for item in equipment_section.find_all("p") | ||
if item.get_text().strip() | ||
] | ||
|
||
def description(self): | ||
description_element = self.soup.find("meta", attrs={"name": "description"}) | ||
return description_element["content"] |
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,49 @@ | ||
{ | ||
"author": "Donal Skehan", | ||
"canonical_url": "https://donalskehan.com/recipes/gingerbread-pancakes/", | ||
"site_name": "Donal Skehan", | ||
"host": "donalskehan.com", | ||
"language": "en-US", | ||
"title": "Gingerbread Pancakes - Donal Skehan | EAT LIVE GO", | ||
"ingredients": [ | ||
"2 tbsp butter, plus extra, melted, for brushing", | ||
"3 tbsp dark brown sugar", | ||
"1 tbsp treacle", | ||
"250g plain flour", | ||
"2 tsp baking powder", | ||
"2 tsp ground ginger", | ||
"2 tsp ground cinnamon", | ||
"½ tsp allspice", | ||
"200ml buttermilk", | ||
"2 large free range eggs", | ||
"1 tsp vanilla bean paste", | ||
"Maple syrup, to serve", | ||
"Creme fraiche, to serve" | ||
], | ||
"instructions_list": [ | ||
"1. Add the butter, sugar and treacle to a small pot and place over a medium high heat until the butter has melted and sugar has dissolved.", | ||
"2. In a large mixing bowl combine the flour with the baking powder and spices. Create a well in the centre and pour in the buttermilk, butter/sugar mixture, eggs and vanilla bean paste. Whisk together until a smooth batter forms.", | ||
"3. Brush a large nonstick frying pan with melted butter and place over a medium heat. Add roughly a tablespoon of the batter per pancake across the pan, leaving space for the batter to expand as it cooks. Cook for 2-3 minutes on either side.", | ||
"4. Keep warm in a low oven before serving with maple syrup and dollops of creme fraiche." | ||
], | ||
"category": "breakfast", | ||
"yields": "4 servings", | ||
"description": "have a new recipe this year for Gingerbread Pancakes which are rich with festive spice and sweetened with dark brown sugar and treacle. A welcome addition to your Christmas morning spread served creme fraiche and copious amounts of maple syrup.", | ||
"total_time": 30, | ||
"equipment": [ | ||
"Small pot", | ||
"Large mixing bowl", | ||
"Large nonstick frying pan" | ||
], | ||
"image": "https://donalskehan.com/wp-content/uploads/Gingerbread-Pancakes-5-copy-1.jpg", | ||
"keywords": [ | ||
"Recipes", | ||
"Winter", | ||
"Breakfast", | ||
"Desserts & Baking", | ||
"Christmas", | ||
"Breakfast", | ||
"pancakes", | ||
"gingerbread" | ||
] | ||
} |
Oops, something went wrong.