-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hhursev:main' into grouping-simplyquinoa
- Loading branch information
Showing
62 changed files
with
22,045 additions
and
3,417 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
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
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
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,35 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
from ._utils import get_equipment | ||
|
||
|
||
class KrollsKorner(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "krollskorner.com" | ||
|
||
def author(self): | ||
author_tag = self.soup.select_one( | ||
".wprm-recipe-details.wprm-recipe-author.wprm-block-text-normal a" | ||
) | ||
return author_tag.get_text(strip=True) | ||
|
||
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.select_one(".wprm-recipe-equipment-container") | ||
if not equipment_container: | ||
return None | ||
|
||
equipment_items = [ | ||
item.select_one(".wprm-recipe-equipment-name").get_text(strip=True) | ||
for item in equipment_container.select(".wprm-recipe-equipment-item") | ||
if item.select_one(".wprm-recipe-equipment-name") | ||
] | ||
return get_equipment(equipment_items) |
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 |
---|---|---|
@@ -1,7 +1,27 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
from ._utils import csv_to_tags, get_equipment | ||
|
||
|
||
class TheKitchenMagPie(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "thekitchenmagpie.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.select_one(".wprm-recipe-details-container") | ||
if equipment_container: | ||
equipment_text = equipment_container.find("dt", string="Equipment") | ||
if equipment_text: | ||
equipment_list = equipment_text.find_next_sibling("dd") | ||
if equipment_list: | ||
return get_equipment(csv_to_tags(equipment_list.text)) | ||
return None |
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,20 @@ | ||
from ._abstract import AbstractScraper | ||
from ._exceptions import StaticValueException | ||
from ._grouping_utils import group_ingredients | ||
|
||
|
||
class TheKitchn(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "thekitchn.com" | ||
|
||
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
".Recipe__ingredientsGroupName", | ||
".Recipe__ingredient", | ||
) | ||
|
||
def site_name(self): | ||
raise StaticValueException(return_value="The Kitchn") |
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
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,16 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
|
||
|
||
class Thewoksoflife(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "thewoksoflife.com" | ||
|
||
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
".wprm-recipe-ingredient-group h4", | ||
".wprm-recipe-ingredient", | ||
) |
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,21 @@ | ||
from ._abstract import AbstractScraper | ||
from ._grouping_utils import group_ingredients | ||
from ._utils import get_equipment | ||
|
||
|
||
class Thinlicious(AbstractScraper): | ||
@classmethod | ||
def host(cls): | ||
return "thinlicious.com" | ||
|
||
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
".wprm-recipe-group-name", | ||
".wprm-recipe-ingredient", | ||
) | ||
|
||
def equipment(self): | ||
equipment_list = self.soup.select(".wprm-recipe-equipment-name") | ||
return get_equipment(item.get_text() for item in equipment_list) |
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
Oops, something went wrong.