-
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.
Add "A Healthy Slice of Life" site (#1413)
- Loading branch information
Showing
5 changed files
with
2,344 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,38 @@ | ||
from ._abstract import AbstractScraper | ||
from ._utils import normalize_string | ||
|
||
|
||
class AHealthySliceOfLife(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "ahealthysliceoflife.com" | ||
|
||
def author(self): | ||
return self.schema.author() | ||
|
||
def title(self): | ||
return self.schema.title() | ||
|
||
def category(self): | ||
return self.schema.category() | ||
|
||
def image(self): | ||
return self.schema.image() | ||
|
||
def ingredients(self): | ||
ingredients = self.soup.find( | ||
"div", {"class": "tasty-recipes-ingredients-body"} | ||
).findAll("p") | ||
return [normalize_string(ing.get_text().strip()) for ing in ingredients] | ||
|
||
def instructions(self): | ||
return self.schema.instructions() | ||
|
||
def ratings(self): | ||
return self.schema.ratings() | ||
|
||
def cuisine(self): | ||
return self.schema.cuisine() | ||
|
||
def description(self): | ||
return self.schema.description() |
31 changes: 31 additions & 0 deletions
31
tests/test_data/ahealthysliceoflife.com/ahealthysliceoflife.json
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,31 @@ | ||
{ | ||
"author": "Brittany Dixon", | ||
"canonical_url": "https://www.ahealthysliceoflife.com/red-lentil-carrot-curry-recipe/", | ||
"site_name": "A Healthy Slice of Life", | ||
"host": "ahealthysliceoflife.com", | ||
"language": "en-US", | ||
"title": "Red Lentil and Carrot Curry Recipe", | ||
"ingredients": [ | ||
"3 Tbsp olive oil", | ||
"3 garlic cloves, minced", | ||
"1.5 tsp grated ginger", | ||
"1 small onion, small diced (about 1 c)", | ||
"2 large carrots, small diced (about 1 c)", | ||
"1.5 Tbsp curry powder", | ||
"1 tsp turmeric", | ||
"1.5 c red lentils", | ||
"1.5 tsp salt", | ||
"1 c vegetable broth", | ||
"1 can full fat coconut milk", | ||
"3 oz chopped baby spinach", | ||
"Juice of half a lime" | ||
], | ||
"instructions_list": [ | ||
"In a large pan, heat oil over medium heat.", | ||
"Add onion and carrots. Sauté 4 minutes until onions are beginning to soften. Add garlic, ginger, curry powder, and turmeric to the pan and sauté for 1-2 minutes more, until fragrant.", | ||
"Add lentils, salt, broth, and coconut milk to the pan. Bring to a boil while mixing well, then cover and reduce heat to a gentle simmer. Let simmer for 20 minutes, then remove from heat.", | ||
"Take off the lid, add spinach and lime juice and stir to combine. Serve over hot buttered rice." | ||
], | ||
"description": "This nourishing curry recipe is perfect for when you need something comforting and delicious on the dinner table quickly!", | ||
"image": "https://www.ahealthysliceoflife.com/wp-content/uploads/2021/08/A-Healthy-Slice_Lentil-Curry-9-scaled-225x225.jpg" | ||
} |
2,272 changes: 2,272 additions & 0 deletions
2,272
tests/test_data/ahealthysliceoflife.com/ahealthysliceoflife.testhtml
Large diffs are not rendered by default.
Oops, something went wrong.