diff --git a/README.rst b/README.rst index a6cd18e48..cf249d30e 100644 --- a/README.rst +++ b/README.rst @@ -253,6 +253,7 @@ Scrapers available for: - `https://kochbucher.com/ `_ - `http://koket.se/ `_ - `https://kristineskitchenblog.com/ `_ +- `https://krollskorner.com/ `_ - `https://kuchnia-domowa.pl/ `_ - `https://kuchynalidla.sk/ `_ - `https://www.kwestiasmaku.com/ `_ diff --git a/recipe_scrapers/__init__.py b/recipe_scrapers/__init__.py index 06f1e5e72..02ab6b109 100644 --- a/recipe_scrapers/__init__.py +++ b/recipe_scrapers/__init__.py @@ -204,6 +204,7 @@ from .kochbucher import Kochbucher from .koket import Koket from .kristineskitchenblog import KristinesKitchenBlog +from .krollskorner import KrollsKorner from .kuchniadomowa import KuchniaDomowa from .kuchynalidla import KuchynaLidla from .kwestiasmaku import KwestiaSmaku @@ -496,6 +497,7 @@ KitchenAidAustralia.host(): KitchenAidAustralia, KitchenDreaming.host(): KitchenDreaming, KristinesKitchenBlog.host(): KristinesKitchenBlog, + KrollsKorner.host(): KrollsKorner, KuchynaLidla.host(): KuchynaLidla, LittleSunnyKitchen.host(): LittleSunnyKitchen, LeitesCulinaria.host(): LeitesCulinaria, diff --git a/recipe_scrapers/krollskorner.py b/recipe_scrapers/krollskorner.py new file mode 100644 index 000000000..4ddc27686 --- /dev/null +++ b/recipe_scrapers/krollskorner.py @@ -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) diff --git a/tests/test_data/krollskorner.com/krollskorner_1.json b/tests/test_data/krollskorner.com/krollskorner_1.json new file mode 100644 index 000000000..f3e277eca --- /dev/null +++ b/tests/test_data/krollskorner.com/krollskorner_1.json @@ -0,0 +1,48 @@ +{ + "author": "Tawnie Graham of Kroll’s Korner", + "canonical_url": "https://krollskorner.com/dietary/vegetarian/kung-pao-pasta/", + "site_name": "Kroll's Korner", + "host": "krollskorner.com", + "language": "en-US", + "title": "Spicy Sesame Noodles", + "ingredients": [ + "1 pound spaghetti (or egg noodles, ramen noodles, etc. )", + "1/2 cup sesame oil", + "1/3 cup avocado oil or canola oil", + "2 tsp. red pepper chili flakes", + "1/2 cup soy sauce", + "1/3 heaping cup honey", + "2 Tbsp. chili garlic sauce (or your favorite chili crunch)", + "2 tsp. rice vinegar", + "1 Tbsp. cornstarch + 1 Tbsp. water (optional )", + "3/4 cup unsalted roasted peanuts, chopped", + "1/2 cup fresh cilantro, chopped", + "1/2 cup green onions, chopped", + "2 Tbsp. toasted sesame seeds" + ], + "instructions_list": [ + "Cook spaghetti, or noodle of choice. Drain and set aside in a large bowl.", + "Add sesame oil, avocado oil, and red pepper chili flakes to a saucepan over medium heat. Cook for just a few minutes or until the chili flakes begin to pop. The longer the chili flakes pop, the spicer the noodles will be.", + "Turn the heat down to low and add the soy sauce, honey, chili garlic sauce, and rice vinegar. Stir and bring the sauce to a simmer.", + "Optional to thicken the sauce add in cornstarch slurry: Start with 1 Tbsp. cornstarch mixed with 1 Tbsp. water and whisk into sauce. You will notice the consistency change. If you want it thicker, add more cornstarch slurry. I don't like my sauce very thick (but that's up to you!)", + "Combine the cooked noodles with the sauce.", + "Add in the peanuts, cilantro, green onions, and sesame seeds. Toss to combine. Garnish with more sesame seeds and green onions. Taste and adjust any seasonings to taste. Enjoy warm or chilled!" + ], + "category": "Side Dish", + "yields": "8 servings", + "description": "These Spicy Sesame Noodles feature the nutty depth of flavor from the toasted sesame oil and a savory umami punch from the soy sauce. The chili garlic sauce and red pepper chili flakes add the fiery spice, balanced by the sweetness of honey and a little rice vinegar for a tangy finish. The cilantro and green onions add freshness and vibrancy and the peanuts add texture and crunch. Serve it cold or warm, you can't go wrong with these noodles; perfect for a main meal or side dish!", + "total_time": 30, + "cook_time": 10, + "prep_time": 20, + "ratings": 4.41, + "ratings_count": 5, + "nutrients": { + "servingSize": "1 serving", + "calories": "432 kcal", + "fatContent": "22 g", + "carbohydrateContent": "48 g", + "proteinContent": "13 g", + "fiberContent": "5 g" + }, + "image": "https://krollskorner.com/wp-content/uploads/2019/06/sesamenoodlesupdate_20-1-of-1.jpg" +} diff --git a/tests/test_data/krollskorner.com/krollskorner_1.testhtml b/tests/test_data/krollskorner.com/krollskorner_1.testhtml new file mode 100644 index 000000000..8c4db13a9 --- /dev/null +++ b/tests/test_data/krollskorner.com/krollskorner_1.testhtml @@ -0,0 +1,3574 @@ + + + + + + + + + + + + + + + Spicy Sesame Noodles + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + +
+ + + + + + + +
+
+ +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/test_data/krollskorner.com/krollskorner_2.json b/tests/test_data/krollskorner.com/krollskorner_2.json new file mode 100644 index 000000000..d126fbf34 --- /dev/null +++ b/tests/test_data/krollskorner.com/krollskorner_2.json @@ -0,0 +1,96 @@ +{ + "author": "Tawnie Graham of Kroll’s Korner", + "canonical_url": "https://krollskorner.com/recipes/dinner/chopped-chicken-salad/", + "site_name": "Kroll's Korner", + "host": "krollskorner.com", + "language": "en-US", + "title": "Chopped Chicken Salad with Sesame Dressing", + "ingredients": [ + "2 cups shredded romaine lettuce", + "2 cups shredded Napa cabbage", + "2 cups shredded red cabbage", + "2 large carrots, julienned (about 1 cup) or you can use the pre shredded carrots", + "1 cup shelled edamame", + "3 cups shredded chicken (~1 1/2 lbs. chicken)", + "3.5 oz. bag crunchy wonton strips or crunchy chow mein noodles", + "1 cup mandarin orange slices, drained", + "1 bunch scallions, chopped (~1/2 cup)", + "1/2 cup sliced almonds", + "1/4 cup grapeseed oil (or canola oil or any other neutral flavored oil)", + "2 Tbsp. sesame oil", + "2 Tbsp. rice wine vinegar", + "2 Tbsp. soy sauce", + "1 Tbsp. brown sugar", + "1 tsp. ginger, minced", + "1 tsp. garlic, minced or pressed thru a garlic press", + "1 tsp. chili garlic sauce", + "1/4 tsp. salt & pepper, or to taste" + ], + "ingredient_groups": [ + { + "ingredients": [ + "2 cups shredded romaine lettuce", + "2 cups shredded Napa cabbage", + "2 cups shredded red cabbage", + "2 large carrots, julienned (about 1 cup) or you can use the pre shredded carrots", + "1 cup shelled edamame", + "3 cups shredded chicken (~1 1/2 lbs. chicken)", + "3.5 oz. bag crunchy wonton strips or crunchy chow mein noodles", + "1 cup mandarin orange slices, drained", + "1 bunch scallions, chopped (~1/2 cup)", + "1/2 cup sliced almonds" + ], + "purpose": "For the salad" + }, + { + "ingredients": [ + "1/4 cup grapeseed oil (or canola oil or any other neutral flavored oil)", + "2 Tbsp. sesame oil", + "2 Tbsp. rice wine vinegar", + "2 Tbsp. soy sauce", + "1 Tbsp. brown sugar", + "1 tsp. ginger, minced", + "1 tsp. garlic, minced or pressed thru a garlic press", + "1 tsp. chili garlic sauce", + "1/4 tsp. salt & pepper, or to taste" + ], + "purpose": "For the dressing" + } + ], + "instructions_list": [ + "In a large salad bowl, combine the romaine, Napa cabbage, red cabbage, carrots, edamame, shredded chicken and wonton noodles.", + "Gently toss in or garnish the salad with mandarin oranges, scallions and slivered almonds.", + "Whisk together the dressing ingredients in a bowl or mason jar and toss the salad with the dressing. Serve. (That's it!?)", + "Serve. (That's it!?) ENJOY!" + ], + "category": "Main Course", + "yields": "6 servings", + "description": "This Chopped Chicken Salad is incredibly delicious and equally simple to make!", + "total_time": 20, + "cook_time": 5, + "prep_time": 15, + "cuisine": "Chinese", + "ratings": 4.81, + "ratings_count": 47, + "equipment": [ + "Cutting board", + "Chefs Knife", + "Measuring cups & spoons" + ], + "nutrients": { + "servingSize": "1 serving", + "calories": "544 kcal", + "fatContent": "35 g", + "saturatedFatContent": "5 g", + "carbohydrateContent": "20 g", + "sugarContent": "10 g", + "proteinContent": "41 g", + "sodiumContent": "757 mg", + "fiberContent": "6 g", + "cholesterolContent": "114 mg" + }, + "image": "https://krollskorner.com/wp-content/uploads/2020/05/Choppedchickensalad-9-scaled.jpg", + "keywords": [ + "chicken salad" + ] +} diff --git a/tests/test_data/krollskorner.com/krollskorner_2.testhtml b/tests/test_data/krollskorner.com/krollskorner_2.testhtml new file mode 100644 index 000000000..394af05fc --- /dev/null +++ b/tests/test_data/krollskorner.com/krollskorner_2.testhtml @@ -0,0 +1,3839 @@ + + + + + + + + + + + + + + + Chopped Chicken Salad with Sesame Dressing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ + +
+ + + + + + + +
+
+ +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file