-
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.
Adds support for fattoincasadabenedetta.it (#868)
- Loading branch information
Showing
5 changed files
with
2,985 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,48 @@ | ||
# mypy: allow-untyped-defs | ||
|
||
from ._abstract import AbstractScraper | ||
from ._utils import normalize_string | ||
|
||
|
||
class FattoInCasaDaBenedetta(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "fattoincasadabenedetta.it" | ||
|
||
def author(self): | ||
return self.schema.author() | ||
|
||
def title(self): | ||
return self.schema.title() | ||
|
||
def category(self): | ||
return self.schema.category() | ||
|
||
def total_time(self): | ||
return self.schema.total_time() | ||
|
||
def yields(self): | ||
return self.schema.yields() | ||
|
||
def image(self): | ||
return self.schema.image() | ||
|
||
def ingredients(self): | ||
return self.schema.ingredients() | ||
|
||
def instructions(self): | ||
step_divs = self.soup.find_all("div", {"class": "step"}) | ||
|
||
all_instructions = [] | ||
for step in step_divs: | ||
instruction_text = normalize_string(step.get_text()) | ||
if instruction_text: | ||
all_instructions.append(instruction_text) | ||
|
||
return "\n".join(all_instructions) | ||
|
||
def ratings(self): | ||
return self.schema.ratings() | ||
|
||
def description(self): | ||
return self.schema.description() |
Oops, something went wrong.