Skip to content

Commit

Permalink
added simplycookit scraper (#618)
Browse files Browse the repository at this point in the history
Co-authored-by: hhursev <hhursev@users.noreply.github.com>
  • Loading branch information
2 people authored and jayaddison committed Dec 16, 2022
1 parent 5606a13 commit a1b33c4
Show file tree
Hide file tree
Showing 4 changed files with 978 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recipe_scrapers/__init__.py
Expand Up @@ -172,6 +172,7 @@
from .saveur import Saveur
from .seriouseats import SeriousEats
from .simpleveganista import SimpleVeganista
from .simplycookit import SimplyCookit
from .simplyquinoa import SimplyQuinoa
from .simplyrecipes import SimplyRecipes
from .simplywhisked import SimplyWhisked
Expand Down Expand Up @@ -402,6 +403,7 @@
Saveur.host(): Saveur,
SeriousEats.host(): SeriousEats,
SimpleVeganista.host(): SimpleVeganista,
SimplyCookit.host(): SimplyCookit,
SimplyQuinoa.host(): SimplyQuinoa,
SimplyRecipes.host(): SimplyRecipes,
SimplyWhisked.host(): SimplyWhisked,
Expand Down
50 changes: 50 additions & 0 deletions recipe_scrapers/simplycookit.py
@@ -0,0 +1,50 @@
from ._abstract import AbstractScraper
from ._utils import normalize_string


class SimplyCookit(AbstractScraper):
@classmethod
def host(cls):
return "simply-cookit.com"

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):
ingredients = []
for li in self.soup.find("ul", {"class": "recipe_ingredients"}).findAll("li"):
ingredients.append(normalize_string(li.get_text()))

return ingredients

def instructions(self):
instructions = []
for li in self.soup.find("ul", {"class": "recipe_steps"}).findAll("li"):
li.find("span", {"class": "number"}).clear()
instructions.append(li.get_text())

return "\n".join(instructions)

def ratings(self):
return self.schema.ratings()

def cuisine(self):
return self.schema.cuisine()

def description(self):
return self.schema.description()

0 comments on commit a1b33c4

Please sign in to comment.