-
Notifications
You must be signed in to change notification settings - Fork 531
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
6 changed files
with
2,754 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,40 @@ | ||
from ._abstract import AbstractScraper | ||
from ._utils import get_minutes, normalize_string | ||
|
||
|
||
class Inspiralized(AbstractScraper): | ||
|
||
@classmethod | ||
def host(self): | ||
return 'inspiralized.com' | ||
|
||
def title(self): | ||
return self.soup.find('h1').get_text() | ||
|
||
def total_time(self): | ||
return get_minutes(self.soup.find( | ||
'span', | ||
{'itemprop': 'totalTime'}) | ||
) | ||
|
||
def ingredients(self): | ||
ingredients = self.soup.findAll( | ||
'li', | ||
{'class': 'ingredient', 'itemprop': 'ingredients'} | ||
) | ||
|
||
return [ | ||
normalize_string(ingredient.get_text()) | ||
for ingredient in ingredients | ||
] | ||
|
||
def instructions(self): | ||
instructions = self.soup.findAll( | ||
'li', | ||
{'class': 'instruction'} | ||
) | ||
|
||
return '\n'.join([ | ||
normalize_string(instruction.get_text()) | ||
for instruction in instructions | ||
]) |
Oops, something went wrong.