forked from hhursev/recipe-scrapers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ingredient grouping & equipment support for skinnytaste (hhursev#1332)
- Loading branch information
Showing
5 changed files
with
3,504 additions
and
1,833 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
|
||
|
||
class SkinnyTaste(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "skinnytaste.com" | ||
|
||
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
".wprm-recipe-ingredient-group h4", | ||
".wprm-recipe-ingredient", | ||
) | ||
|
||
def equipment(self): | ||
equipment_container = self.soup.find( | ||
"div", class_="wprm-recipe-equipment-container" | ||
) | ||
if equipment_container: | ||
return [ | ||
item.get_text(strip=True) | ||
for item in equipment_container.find_all( | ||
"div", class_="wprm-recipe-equipment-name" | ||
) | ||
] | ||
return None |
File renamed without changes.
Oops, something went wrong.