From d39160e13aed657dae028b20c0d0f0f55814ce90 Mon Sep 17 00:00:00 2001 From: muchomuchacho <4213495+muchomuchacho@users.noreply.github.com> Date: Fri, 3 Jul 2020 23:40:09 +0100 Subject: [PATCH 1/4] Fix line breaks for the `gousto.co.uk` instructions section (#175) * Fix line breaks for the instructions section * Adapt test to new line breaks --- recipe_scrapers/gousto.py | 22 +++++++++++++--------- tests/test_gousto.py | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/recipe_scrapers/gousto.py b/recipe_scrapers/gousto.py index 7d9c37cb2..e16aa5c75 100644 --- a/recipe_scrapers/gousto.py +++ b/recipe_scrapers/gousto.py @@ -5,7 +5,7 @@ class Gousto(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'gousto.co.uk' def title(self): @@ -25,7 +25,7 @@ def yields(self): 'div', {'id': 'ingredients'} ).find( - 'div', + 'div', {'class': 'panel-subheading'} ).get_text() @@ -47,11 +47,12 @@ def ingredients(self): 'div', {'class': 'panel-subheading'} ).get_text() - + extras = extras.strip().split(', ') ingredients = [ - normalize_string(ingredient.get_text()) for ingredient in ingredients] + normalize_string(ingredient.get_text()) + for ingredient in ingredients] for extra in extras: ingredients.append(extra) @@ -67,10 +68,14 @@ def instructions(self): {'class': 'indivrecipe-cooking-text-wrapper'} ) - return '\n'.join([ - normalize_string(instruction.get_text()) - for instruction in instructions - ]) + instr_container = [p.get_text() + for subdiv in instructions + for p in subdiv.findAll('p')] + + return '\n'.join( + normalize_string(instruction) + for instruction in instr_container + ) def ratings(self): ratings = self.soup.find( @@ -84,4 +89,3 @@ def ratings(self): rating = int(ratings['alt'][0]) return rating - \ No newline at end of file diff --git a/tests/test_gousto.py b/tests/test_gousto.py index ccca4288a..b4dd57771 100644 --- a/tests/test_gousto.py +++ b/tests/test_gousto.py @@ -40,7 +40,7 @@ def test_ingredients(self): def test_instructions(self): return self.assertEqual( - "Preheat the oven to 200°C/ 180°C (fan)/ 400°F/ Gas 6 Boil a kettle (used in steps 3 & 5)\nAdd 1-2 tbsp of olive oil to a pan on a high heat Once the oil is hot, sear the pork tenderloin for 2 min on each side, or until browned all over (keep the pan for step 6) Season to your taste with salt and pepper\nPlace the pork on an oven-proof tray and put in the oven for 8-10 min, or until cooked through Once done, remove from the oven, cover well and allow to rest until step 7 Dissolve half the (whole) beef stock cube in 100ml (200ml) of boiling water\nCut the mushrooms into quarters Peel the onion(s) and chop finely Crush the garlic with the side of a knife, peel it and chop finely Chop the parsley finely\nCook the pasta in a pot of boiling water and salt (optional) for 8-10 min or until the pasta is cooked to your taste, stirring occasionally, then drain\nReturn the pork pan to a medium-high heat, add the garlic and onion and cook for 1 min Add the mushrooms and cook for 1 min Reduce the heat, add the stock and 50ml (100ml) of cream and simmer for 5 min Add the parsley\nGrate the parmesan Cut the pork into slices (approx. 2cm) Season the mushroom sauce to your taste with salt and pepper\nAdd the pasta to the sauce and mix well Serve the pasta with the pork on top and sprinkle with parmesan Enjoy!", + "Preheat the oven to 200°C/ 180°C (fan)/ 400°F/ Gas 6\nBoil a kettle (used in steps 3 & 5)\nAdd 1-2 tbsp of olive oil to a pan on a high heat\nOnce the oil is hot, sear the pork tenderloin for 2 min on each side, or until browned all over (keep the pan for step 6)\nSeason to your taste with salt and pepper\nPlace the pork on an oven-proof tray and put in the oven for 8-10 min, or until cooked through\nOnce done, remove from the oven, cover well and allow to rest until step 7\nDissolve half the (whole) beef stock cube in 100ml (200ml) of boiling water\nCut the mushrooms into quarters\nPeel the onion(s) and chop finely\nCrush the garlic with the side of a knife, peel it and chop finely\nChop the parsley finely\nCook the pasta in a pot of boiling water and salt (optional) for 8-10 min or until the pasta is cooked to your taste, stirring occasionally, then drain\nReturn the pork pan to a medium-high heat, add the garlic and onion and cook for 1 min\nAdd the mushrooms and cook for 1 min\nReduce the heat, add the stock and 50ml (100ml) of cream and simmer for 5 min\nAdd the parsley\nGrate the parmesan\nCut the pork into slices (approx. 2cm)\nSeason the mushroom sauce to your taste with salt and pepper\nAdd the pasta to the sauce and mix well\nServe the pasta with the pork on top and sprinkle with parmesan\nEnjoy!", self.harvester_class.instructions(), ) From e75faf65757678d5e221ed1950a40d44303b6c1e Mon Sep 17 00:00:00 2001 From: hhursev Date: Sat, 4 Jul 2020 02:13:15 +0300 Subject: [PATCH 2/4] Classmethods first argument to be named cls (though not used) instead of self --- recipe_scrapers/_abstract.py | 5 +++-- recipe_scrapers/acouplecooks.py | 8 ++++---- recipe_scrapers/allrecipes.py | 2 +- recipe_scrapers/archanaskitchen.py | 2 +- recipe_scrapers/bbcgoodfood.py | 2 +- recipe_scrapers/bettycrocker.py | 2 +- recipe_scrapers/bonappetit.py | 2 +- recipe_scrapers/budgetbytes.py | 2 +- recipe_scrapers/closetcooking.py | 2 +- recipe_scrapers/cookieandkate.py | 4 ++-- recipe_scrapers/cookpad.py | 2 +- recipe_scrapers/cookstr.py | 2 +- recipe_scrapers/copykat.py | 8 ++++---- recipe_scrapers/countryliving.py | 4 ++-- recipe_scrapers/cybercook.py | 2 +- recipe_scrapers/delish.py | 3 ++- recipe_scrapers/epicurious.py | 2 +- recipe_scrapers/finedininglovers.py | 2 +- recipe_scrapers/fitmencook.py | 2 +- recipe_scrapers/food.py | 2 +- recipe_scrapers/foodnetwork.py | 2 +- recipe_scrapers/foodrepublic.py | 2 +- recipe_scrapers/geniuskitchen.py | 2 +- recipe_scrapers/giallozafferano.py | 2 +- recipe_scrapers/gonnawantseconds.py | 6 +++--- recipe_scrapers/greatbritishchefs.py | 4 ++-- recipe_scrapers/heinzbrasil.py | 4 ++-- recipe_scrapers/hundredandonecookbooks.py | 2 +- recipe_scrapers/ig.py | 4 ++-- recipe_scrapers/inspiralized.py | 2 +- recipe_scrapers/jamieoliver.py | 2 +- recipe_scrapers/justbento.py | 2 +- recipe_scrapers/kennymcgovern.py | 2 +- recipe_scrapers/kochbar.py | 2 +- recipe_scrapers/marmiton.py | 3 +-- recipe_scrapers/matprat.py | 2 +- recipe_scrapers/mindmegette.py | 2 +- recipe_scrapers/misya.py | 2 +- recipe_scrapers/momswithcrockpots.py | 4 ++-- recipe_scrapers/motherthyme.py | 4 ++-- recipe_scrapers/mybakingaddiction.py | 2 +- recipe_scrapers/myrecipes.py | 4 ++-- recipe_scrapers/nihhealthyeating.py | 2 +- recipe_scrapers/nytimes.py | 4 ++-- recipe_scrapers/ohsheglows.py | 4 ++-- recipe_scrapers/panelinha.py | 2 +- recipe_scrapers/paninihappy.py | 2 +- recipe_scrapers/przepisy.py | 5 ++--- recipe_scrapers/realsimple.py | 2 +- recipe_scrapers/seriouseats.py | 2 +- recipe_scrapers/simplyquinoa.py | 4 ++-- recipe_scrapers/simplyrecipes.py | 2 +- recipe_scrapers/southernliving.py | 2 +- recipe_scrapers/spendwithpennies.py | 2 +- recipe_scrapers/steamykitchen.py | 2 +- recipe_scrapers/tastesoflizzyt.py | 2 +- recipe_scrapers/tastykitchen.py | 2 +- recipe_scrapers/thehappyfoodie.py | 2 +- recipe_scrapers/thekitchn.py | 2 +- recipe_scrapers/thepioneerwoman.py | 2 +- recipe_scrapers/thespruceeats.py | 2 +- recipe_scrapers/thevintagemixer.py | 2 +- recipe_scrapers/tineno.py | 2 +- recipe_scrapers/tudogostoso.py | 2 +- recipe_scrapers/twopeasandtheirpod.py | 2 +- recipe_scrapers/vegolosi.py | 2 +- recipe_scrapers/whatsgabycooking.py | 2 +- recipe_scrapers/wikicookbook.py | 2 +- recipe_scrapers/yummly.py | 2 +- 69 files changed, 92 insertions(+), 92 deletions(-) diff --git a/recipe_scrapers/_abstract.py b/recipe_scrapers/_abstract.py index 4e225fb08..ce992ecff 100644 --- a/recipe_scrapers/_abstract.py +++ b/recipe_scrapers/_abstract.py @@ -34,8 +34,9 @@ def __init__(self, url, exception_handling=True, meta_http_equiv=False, test=Fal def url(self): return self.url - def host(self): - """ get the host of the url, so we can use the correct scraper """ + @classmethod + def host(cls): + """ get the hostdef of the url, so we can use the correct scraper """ raise NotImplementedError("This should be implemented.") @Decorators.normalize_string_output diff --git a/recipe_scrapers/acouplecooks.py b/recipe_scrapers/acouplecooks.py index 02ddb07f5..856e3a04d 100644 --- a/recipe_scrapers/acouplecooks.py +++ b/recipe_scrapers/acouplecooks.py @@ -4,15 +4,15 @@ class ACoupleCooks(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'acouplecooks.com' def title(self): return self.soup.find( - 'h2', - {'class': 'tasty-recipes-title'} + 'h2', + {'class': 'tasty-recipes-title'} ).get_text() - + def total_time(self): return get_minutes(self.soup.find( 'span', diff --git a/recipe_scrapers/allrecipes.py b/recipe_scrapers/allrecipes.py index 67d1e13a6..2f3d0a244 100644 --- a/recipe_scrapers/allrecipes.py +++ b/recipe_scrapers/allrecipes.py @@ -4,5 +4,5 @@ class AllRecipes(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'allrecipes.com' diff --git a/recipe_scrapers/archanaskitchen.py b/recipe_scrapers/archanaskitchen.py index 166bd9119..71c77f798 100644 --- a/recipe_scrapers/archanaskitchen.py +++ b/recipe_scrapers/archanaskitchen.py @@ -4,5 +4,5 @@ class ArchanasKitchen(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'archanaskitchen.com' diff --git a/recipe_scrapers/bbcgoodfood.py b/recipe_scrapers/bbcgoodfood.py index 6b0d68838..f5b05d963 100644 --- a/recipe_scrapers/bbcgoodfood.py +++ b/recipe_scrapers/bbcgoodfood.py @@ -5,7 +5,7 @@ class BBCGoodFood(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'bbcgoodfood.com' def title(self): diff --git a/recipe_scrapers/bettycrocker.py b/recipe_scrapers/bettycrocker.py index bd3975736..0fca85f3d 100644 --- a/recipe_scrapers/bettycrocker.py +++ b/recipe_scrapers/bettycrocker.py @@ -10,7 +10,7 @@ class BettyCrocker(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'bettycrocker.com' def title(self): diff --git a/recipe_scrapers/bonappetit.py b/recipe_scrapers/bonappetit.py index e89777e71..302cef5f8 100644 --- a/recipe_scrapers/bonappetit.py +++ b/recipe_scrapers/bonappetit.py @@ -5,7 +5,7 @@ class BonAppetit(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'bonappetit.com' def title(self): diff --git a/recipe_scrapers/budgetbytes.py b/recipe_scrapers/budgetbytes.py index ea91fc113..5759d05d3 100644 --- a/recipe_scrapers/budgetbytes.py +++ b/recipe_scrapers/budgetbytes.py @@ -5,7 +5,7 @@ class BudgetBytes(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'budgetbytes.com' def title(self): diff --git a/recipe_scrapers/closetcooking.py b/recipe_scrapers/closetcooking.py index 3c5fb96ce..1f0d43911 100644 --- a/recipe_scrapers/closetcooking.py +++ b/recipe_scrapers/closetcooking.py @@ -5,7 +5,7 @@ class ClosetCooking(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'closetcooking.com' def title(self): diff --git a/recipe_scrapers/cookieandkate.py b/recipe_scrapers/cookieandkate.py index 030592c14..701ff7ec9 100644 --- a/recipe_scrapers/cookieandkate.py +++ b/recipe_scrapers/cookieandkate.py @@ -5,7 +5,7 @@ class CookieAndKate(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'cookieandkate.com' def title(self): @@ -56,4 +56,4 @@ def ratings(self): "span", {"class": "average"} ).get_text()), 2 - ) \ No newline at end of file + ) diff --git a/recipe_scrapers/cookpad.py b/recipe_scrapers/cookpad.py index f4104120c..cf5cff043 100644 --- a/recipe_scrapers/cookpad.py +++ b/recipe_scrapers/cookpad.py @@ -4,5 +4,5 @@ class CookPad(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'cookpad.com' diff --git a/recipe_scrapers/cookstr.py b/recipe_scrapers/cookstr.py index 8c1036671..df0a0d303 100644 --- a/recipe_scrapers/cookstr.py +++ b/recipe_scrapers/cookstr.py @@ -5,7 +5,7 @@ class Cookstr(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'cookstr.com' def title(self): diff --git a/recipe_scrapers/copykat.py b/recipe_scrapers/copykat.py index 2e9099b07..c05a94bde 100644 --- a/recipe_scrapers/copykat.py +++ b/recipe_scrapers/copykat.py @@ -10,7 +10,7 @@ class CopyKat(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'copykat.com' def title(self): @@ -30,7 +30,7 @@ def total_time(self): {'class': 'wprm-recipe-details wprm-recipe-details-minutes wprm-recipe-total_time wprm-recipe-total_time-minutes'} ).get_text() if tt1: - tt3 = (int(tt1)*60) + int(tt2) + tt3 = (int(tt1) * 60) + int(tt2) tt2 = get_minutes(tt3) if tt3 and (tt2 == 0): total_time = tt3 @@ -70,7 +70,7 @@ def ingredients(self): 'class': "wprm-recipe-group-name wprm-recipe-ingredient-group-name wprm-block-text-bold"}).text except Exception: header = None - if header != None: + if header is not None: ingGroup.append(header) ingredparts = ig.findAll('li') for i in ingredparts: @@ -91,7 +91,7 @@ def instructions(self): {'class': 'wprm-recipe-group-name wprm-recipe-instruction-group-name wprm-block-text-bold'}).text except Exception: header = None - if header != None: + if header is not None: data.append(header) ins = instruct.findAll( 'div', {'class': 'wprm-recipe-instruction-text'}) diff --git a/recipe_scrapers/countryliving.py b/recipe_scrapers/countryliving.py index d896cf08b..917dc2735 100644 --- a/recipe_scrapers/countryliving.py +++ b/recipe_scrapers/countryliving.py @@ -5,7 +5,7 @@ class CountryLiving(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'countryliving.com' def title(self): @@ -48,4 +48,4 @@ def instructions(self): return '\n'.join([ normalize_string(instruction.get_text()) for instruction in instructions - ]) \ No newline at end of file + ]) diff --git a/recipe_scrapers/cybercook.py b/recipe_scrapers/cybercook.py index 6a95b0a08..bf410c50a 100644 --- a/recipe_scrapers/cybercook.py +++ b/recipe_scrapers/cybercook.py @@ -4,5 +4,5 @@ class Cybercook(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'cybercook.com.br' diff --git a/recipe_scrapers/delish.py b/recipe_scrapers/delish.py index 62017b133..3bea4774f 100644 --- a/recipe_scrapers/delish.py +++ b/recipe_scrapers/delish.py @@ -6,10 +6,11 @@ from ._abstract import AbstractScraper from ._utils import get_minutes, normalize_string, get_yields + class Delish(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'delish.com' def title(self): diff --git a/recipe_scrapers/epicurious.py b/recipe_scrapers/epicurious.py index 6137c4cde..03f3be768 100644 --- a/recipe_scrapers/epicurious.py +++ b/recipe_scrapers/epicurious.py @@ -5,7 +5,7 @@ class Epicurious(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'epicurious.com' def title(self): diff --git a/recipe_scrapers/finedininglovers.py b/recipe_scrapers/finedininglovers.py index dbf6c4ccb..e0c9c8e21 100644 --- a/recipe_scrapers/finedininglovers.py +++ b/recipe_scrapers/finedininglovers.py @@ -5,7 +5,7 @@ class FineDiningLovers(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'finedininglovers.com' def title(self): diff --git a/recipe_scrapers/fitmencook.py b/recipe_scrapers/fitmencook.py index f4bf29974..b289c956b 100644 --- a/recipe_scrapers/fitmencook.py +++ b/recipe_scrapers/fitmencook.py @@ -4,7 +4,7 @@ class FitMenCook(AbstractScraper): @classmethod - def host(self): + def host(cls): return "fitmencook.com" def title(self): diff --git a/recipe_scrapers/food.py b/recipe_scrapers/food.py index a5faff146..6006fee18 100644 --- a/recipe_scrapers/food.py +++ b/recipe_scrapers/food.py @@ -5,7 +5,7 @@ class Food(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'food.com' def title(self): diff --git a/recipe_scrapers/foodnetwork.py b/recipe_scrapers/foodnetwork.py index 8823e09f4..53817cbd3 100644 --- a/recipe_scrapers/foodnetwork.py +++ b/recipe_scrapers/foodnetwork.py @@ -5,7 +5,7 @@ class FoodNetwork(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'foodnetwork.com' def title(self): diff --git a/recipe_scrapers/foodrepublic.py b/recipe_scrapers/foodrepublic.py index a87f537e8..c972bd1a9 100644 --- a/recipe_scrapers/foodrepublic.py +++ b/recipe_scrapers/foodrepublic.py @@ -5,7 +5,7 @@ class FoodRepublic(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'foodrepublic.com' def title(self): diff --git a/recipe_scrapers/geniuskitchen.py b/recipe_scrapers/geniuskitchen.py index 4a9e63231..6924faea8 100644 --- a/recipe_scrapers/geniuskitchen.py +++ b/recipe_scrapers/geniuskitchen.py @@ -5,7 +5,7 @@ class GeniusKitchen(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'geniuskitchen.com' def title(self): diff --git a/recipe_scrapers/giallozafferano.py b/recipe_scrapers/giallozafferano.py index b0b22f3aa..81bf96a7e 100644 --- a/recipe_scrapers/giallozafferano.py +++ b/recipe_scrapers/giallozafferano.py @@ -5,7 +5,7 @@ class GialloZafferano(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'ricette.giallozafferano.it' def title(self): diff --git a/recipe_scrapers/gonnawantseconds.py b/recipe_scrapers/gonnawantseconds.py index 937c2d145..7f283125c 100644 --- a/recipe_scrapers/gonnawantseconds.py +++ b/recipe_scrapers/gonnawantseconds.py @@ -4,13 +4,13 @@ # 9 February, 2020 # ======================================================= from ._abstract import AbstractScraper -from ._utils import get_minutes, normalize_string, get_yields +from ._utils import get_minutes, normalize_string class GonnaWantSeconds(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'gonnawantseconds.com' def title(self): @@ -30,7 +30,7 @@ def total_time(self): {'class': 'wprm-recipe-details wprm-recipe-details-minutes wprm-recipe-total_time wprm-recipe-total_time-minutes'} ).get_text() if tt1: - tt3 = (int(tt1)*60) + int(tt2) + tt3 = (int(tt1) * 60) + int(tt2) tt2 = get_minutes(tt3) if tt3 and (tt2 == 0): total_time = tt3 diff --git a/recipe_scrapers/greatbritishchefs.py b/recipe_scrapers/greatbritishchefs.py index 835c8c66f..a947b83fa 100644 --- a/recipe_scrapers/greatbritishchefs.py +++ b/recipe_scrapers/greatbritishchefs.py @@ -4,13 +4,13 @@ # 6 February, 2020 # ======================================================= from ._abstract import AbstractScraper -from ._utils import get_minutes, normalize_string, get_yields +from ._utils import get_minutes, normalize_string class GreatBritishChefs(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'greatbritishchefs.com' def title(self): diff --git a/recipe_scrapers/heinzbrasil.py b/recipe_scrapers/heinzbrasil.py index bbeef2d81..128a702c2 100644 --- a/recipe_scrapers/heinzbrasil.py +++ b/recipe_scrapers/heinzbrasil.py @@ -1,11 +1,11 @@ from ._abstract import AbstractScraper -from ._utils import get_minutes, normalize_string, get_yields +from ._utils import normalize_string class HeinzBrasil(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'heinzbrasil.com.br' def title(self): diff --git a/recipe_scrapers/hundredandonecookbooks.py b/recipe_scrapers/hundredandonecookbooks.py index bc22e990c..3828edc25 100644 --- a/recipe_scrapers/hundredandonecookbooks.py +++ b/recipe_scrapers/hundredandonecookbooks.py @@ -5,7 +5,7 @@ class HundredAndOneCookbooks(AbstractScraper): @classmethod - def host(self): + def host(cls): return '101cookbooks.com' def title(self): diff --git a/recipe_scrapers/ig.py b/recipe_scrapers/ig.py index d3b254e68..90a53b2b2 100644 --- a/recipe_scrapers/ig.py +++ b/recipe_scrapers/ig.py @@ -1,11 +1,11 @@ from ._abstract import AbstractScraper -from ._utils import get_minutes, normalize_string, get_yields +from ._utils import normalize_string, get_yields class IG(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'receitas.ig.com.br' def title(self): diff --git a/recipe_scrapers/inspiralized.py b/recipe_scrapers/inspiralized.py index c385fff03..2ce44e37a 100644 --- a/recipe_scrapers/inspiralized.py +++ b/recipe_scrapers/inspiralized.py @@ -5,7 +5,7 @@ class Inspiralized(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'inspiralized.com' def title(self): diff --git a/recipe_scrapers/jamieoliver.py b/recipe_scrapers/jamieoliver.py index ef028bda5..3b493ca75 100644 --- a/recipe_scrapers/jamieoliver.py +++ b/recipe_scrapers/jamieoliver.py @@ -5,7 +5,7 @@ class JamieOliver(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'jamieoliver.com' def title(self): diff --git a/recipe_scrapers/justbento.py b/recipe_scrapers/justbento.py index a1570af63..b9979f88b 100644 --- a/recipe_scrapers/justbento.py +++ b/recipe_scrapers/justbento.py @@ -5,7 +5,7 @@ class JustBento(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'justbento.com' def title(self): diff --git a/recipe_scrapers/kennymcgovern.py b/recipe_scrapers/kennymcgovern.py index bcde397c0..0c7a4b425 100644 --- a/recipe_scrapers/kennymcgovern.py +++ b/recipe_scrapers/kennymcgovern.py @@ -5,7 +5,7 @@ class KennyMcGovern(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'kennymcgovern.com' def title(self): diff --git a/recipe_scrapers/kochbar.py b/recipe_scrapers/kochbar.py index fc0b94e88..41628f60c 100644 --- a/recipe_scrapers/kochbar.py +++ b/recipe_scrapers/kochbar.py @@ -4,5 +4,5 @@ class Kochbar(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'kochbar.de' diff --git a/recipe_scrapers/marmiton.py b/recipe_scrapers/marmiton.py index 8e5de2545..a36670960 100644 --- a/recipe_scrapers/marmiton.py +++ b/recipe_scrapers/marmiton.py @@ -4,7 +4,7 @@ class Marmiton(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'marmiton.org' def title(self): @@ -27,4 +27,3 @@ def instructions(self): def ratings(self): return self.schema.ratings() - diff --git a/recipe_scrapers/matprat.py b/recipe_scrapers/matprat.py index 6484c83f6..b70f1b233 100644 --- a/recipe_scrapers/matprat.py +++ b/recipe_scrapers/matprat.py @@ -5,7 +5,7 @@ class Matprat(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'matprat.no' def title(self): diff --git a/recipe_scrapers/mindmegette.py b/recipe_scrapers/mindmegette.py index 63d303c4d..6f10a880f 100644 --- a/recipe_scrapers/mindmegette.py +++ b/recipe_scrapers/mindmegette.py @@ -5,7 +5,7 @@ class Mindmegette(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'mindmegette.hu' def title(self): diff --git a/recipe_scrapers/misya.py b/recipe_scrapers/misya.py index 81c2c73bd..6e4c2df2f 100644 --- a/recipe_scrapers/misya.py +++ b/recipe_scrapers/misya.py @@ -4,5 +4,5 @@ class Misya(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'misya.info' diff --git a/recipe_scrapers/momswithcrockpots.py b/recipe_scrapers/momswithcrockpots.py index b4f7aa0e9..bc7c36adb 100644 --- a/recipe_scrapers/momswithcrockpots.py +++ b/recipe_scrapers/momswithcrockpots.py @@ -5,7 +5,7 @@ class MomsWithCrockPots(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'momswithcrockpots.com' def title(self): @@ -56,4 +56,4 @@ def ratings(self): "span", {"class": "wprm-recipe-rating-average"} ).get_text()), 2 - ) \ No newline at end of file + ) diff --git a/recipe_scrapers/motherthyme.py b/recipe_scrapers/motherthyme.py index c689a1fae..ab6d1697a 100644 --- a/recipe_scrapers/motherthyme.py +++ b/recipe_scrapers/motherthyme.py @@ -5,7 +5,7 @@ class MotherThyme(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'motherthyme.com' def title(self): @@ -56,4 +56,4 @@ def ratings(self): "span", {"class": "wprm-recipe-rating-average"} ).get_text()), 2 - ) \ No newline at end of file + ) diff --git a/recipe_scrapers/mybakingaddiction.py b/recipe_scrapers/mybakingaddiction.py index aa1010a63..0a7060324 100644 --- a/recipe_scrapers/mybakingaddiction.py +++ b/recipe_scrapers/mybakingaddiction.py @@ -5,7 +5,7 @@ class MyBakingAddiction(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'mybakingaddiction.com' def title(self): diff --git a/recipe_scrapers/myrecipes.py b/recipe_scrapers/myrecipes.py index be32e0025..b74793e6a 100644 --- a/recipe_scrapers/myrecipes.py +++ b/recipe_scrapers/myrecipes.py @@ -2,8 +2,8 @@ class MyRecipes(AbstractScraper): - + @classmethod - def host(self): + def host(cls): return 'myrecipes.com' \ No newline at end of file diff --git a/recipe_scrapers/nihhealthyeating.py b/recipe_scrapers/nihhealthyeating.py index b940879e8..2f60b7f2a 100644 --- a/recipe_scrapers/nihhealthyeating.py +++ b/recipe_scrapers/nihhealthyeating.py @@ -5,7 +5,7 @@ class NIHHealthyEating(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'healthyeating.nhlbi.nih.gov' def title(self): diff --git a/recipe_scrapers/nytimes.py b/recipe_scrapers/nytimes.py index 64cb34346..0eb57ea76 100644 --- a/recipe_scrapers/nytimes.py +++ b/recipe_scrapers/nytimes.py @@ -2,8 +2,8 @@ class NYTimes(AbstractScraper): - + @classmethod - def host(self): + def host(cls): return 'cooking.nytimes.com' \ No newline at end of file diff --git a/recipe_scrapers/ohsheglows.py b/recipe_scrapers/ohsheglows.py index 3a4885b32..02aa29f6f 100644 --- a/recipe_scrapers/ohsheglows.py +++ b/recipe_scrapers/ohsheglows.py @@ -2,8 +2,8 @@ class OhSheGlows(AbstractScraper): - + @classmethod - def host(self): + def host(cls): return 'ohsheglows.com' \ No newline at end of file diff --git a/recipe_scrapers/panelinha.py b/recipe_scrapers/panelinha.py index 765e137c9..f66b03e68 100644 --- a/recipe_scrapers/panelinha.py +++ b/recipe_scrapers/panelinha.py @@ -5,7 +5,7 @@ class Panelinha(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'panelinha.com.br' def title(self): diff --git a/recipe_scrapers/paninihappy.py b/recipe_scrapers/paninihappy.py index 06a49b051..57197dfff 100644 --- a/recipe_scrapers/paninihappy.py +++ b/recipe_scrapers/paninihappy.py @@ -5,7 +5,7 @@ class PaniniHappy(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'paninihappy.com' def title(self): diff --git a/recipe_scrapers/przepisy.py b/recipe_scrapers/przepisy.py index 3e4b6aece..4c54d8dac 100644 --- a/recipe_scrapers/przepisy.py +++ b/recipe_scrapers/przepisy.py @@ -5,7 +5,7 @@ class Przepisy(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'przepisy.pl' def title(self): @@ -33,8 +33,7 @@ def ingredients(self): ) return [ - normalize_string(i.get_text()) + ' ' + - normalize_string(j.get_text()) + normalize_string(i.get_text()) + ' ' + normalize_string(j.get_text()) for i, j in zip(ingredients[0::2], ingredients[1::2]) ] diff --git a/recipe_scrapers/realsimple.py b/recipe_scrapers/realsimple.py index 89191774d..f9bae6f27 100644 --- a/recipe_scrapers/realsimple.py +++ b/recipe_scrapers/realsimple.py @@ -5,7 +5,7 @@ class RealSimple(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'realsimple.com' def title(self): diff --git a/recipe_scrapers/seriouseats.py b/recipe_scrapers/seriouseats.py index 0a325787c..48dd984b1 100644 --- a/recipe_scrapers/seriouseats.py +++ b/recipe_scrapers/seriouseats.py @@ -5,7 +5,7 @@ class SeriousEats(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'seriouseats.com' def title(self): diff --git a/recipe_scrapers/simplyquinoa.py b/recipe_scrapers/simplyquinoa.py index 79020c73a..3d53670f9 100644 --- a/recipe_scrapers/simplyquinoa.py +++ b/recipe_scrapers/simplyquinoa.py @@ -5,7 +5,7 @@ class SimplyQuinoa(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'simplyquinoa.com' def title(self): @@ -56,4 +56,4 @@ def ratings(self): "span", {"class": "wprm-recipe-rating-average"} ).get_text()), 2 - ) \ No newline at end of file + ) diff --git a/recipe_scrapers/simplyrecipes.py b/recipe_scrapers/simplyrecipes.py index 8f75f8796..c15414fac 100644 --- a/recipe_scrapers/simplyrecipes.py +++ b/recipe_scrapers/simplyrecipes.py @@ -5,7 +5,7 @@ class SimplyRecipes(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'simplyrecipes.com' def title(self): diff --git a/recipe_scrapers/southernliving.py b/recipe_scrapers/southernliving.py index 1562d4e65..3fa5f922d 100644 --- a/recipe_scrapers/southernliving.py +++ b/recipe_scrapers/southernliving.py @@ -10,7 +10,7 @@ class SouthernLiving(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'southernliving.com' def title(self): diff --git a/recipe_scrapers/spendwithpennies.py b/recipe_scrapers/spendwithpennies.py index e0f113686..88c702c90 100644 --- a/recipe_scrapers/spendwithpennies.py +++ b/recipe_scrapers/spendwithpennies.py @@ -4,5 +4,5 @@ class SpendWithPennies(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'spendwithpennies.com' diff --git a/recipe_scrapers/steamykitchen.py b/recipe_scrapers/steamykitchen.py index 6112a2bdf..1b7e61b95 100644 --- a/recipe_scrapers/steamykitchen.py +++ b/recipe_scrapers/steamykitchen.py @@ -5,7 +5,7 @@ class SteamyKitchen(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'steamykitchen.com' def title(self): diff --git a/recipe_scrapers/tastesoflizzyt.py b/recipe_scrapers/tastesoflizzyt.py index 0a496a157..bd24a61b3 100644 --- a/recipe_scrapers/tastesoflizzyt.py +++ b/recipe_scrapers/tastesoflizzyt.py @@ -5,7 +5,7 @@ class TastesOfLizzyT(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'tastesoflizzyt.com' def title(self): diff --git a/recipe_scrapers/tastykitchen.py b/recipe_scrapers/tastykitchen.py index e8570fd4a..0519848aa 100644 --- a/recipe_scrapers/tastykitchen.py +++ b/recipe_scrapers/tastykitchen.py @@ -5,7 +5,7 @@ class TastyKitchen(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'tastykitchen.com' def title(self): diff --git a/recipe_scrapers/thehappyfoodie.py b/recipe_scrapers/thehappyfoodie.py index 5007c773c..68b6a8633 100644 --- a/recipe_scrapers/thehappyfoodie.py +++ b/recipe_scrapers/thehappyfoodie.py @@ -4,7 +4,7 @@ class TheHappyFoodie(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'thehappyfoodie.co.uk' def title(self): diff --git a/recipe_scrapers/thekitchn.py b/recipe_scrapers/thekitchn.py index 575dc015d..ac1ca2ba4 100644 --- a/recipe_scrapers/thekitchn.py +++ b/recipe_scrapers/thekitchn.py @@ -5,7 +5,7 @@ class TheKitchn(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'thekitchn.com' def title(self): diff --git a/recipe_scrapers/thepioneerwoman.py b/recipe_scrapers/thepioneerwoman.py index 0b8ca014b..cd790beaf 100644 --- a/recipe_scrapers/thepioneerwoman.py +++ b/recipe_scrapers/thepioneerwoman.py @@ -5,7 +5,7 @@ class ThePioneerWoman(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'thepioneerwoman.com' def title(self): diff --git a/recipe_scrapers/thespruceeats.py b/recipe_scrapers/thespruceeats.py index 89a131d2b..ff11b6c17 100644 --- a/recipe_scrapers/thespruceeats.py +++ b/recipe_scrapers/thespruceeats.py @@ -5,7 +5,7 @@ class TheSpruceEats(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'thespruceeats.com' def ingredients(self): diff --git a/recipe_scrapers/thevintagemixer.py b/recipe_scrapers/thevintagemixer.py index 48773c2f8..72238d9ac 100644 --- a/recipe_scrapers/thevintagemixer.py +++ b/recipe_scrapers/thevintagemixer.py @@ -5,7 +5,7 @@ class TheVintageMixer(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'thevintagemixer.com' def title(self): diff --git a/recipe_scrapers/tineno.py b/recipe_scrapers/tineno.py index aaeded807..b930e7d34 100644 --- a/recipe_scrapers/tineno.py +++ b/recipe_scrapers/tineno.py @@ -5,7 +5,7 @@ class TineNo(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'tine.no' def title(self): diff --git a/recipe_scrapers/tudogostoso.py b/recipe_scrapers/tudogostoso.py index d676a5eab..f789662b2 100644 --- a/recipe_scrapers/tudogostoso.py +++ b/recipe_scrapers/tudogostoso.py @@ -5,7 +5,7 @@ class TudoGostoso(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'tudogostoso.com.br' def title(self): diff --git a/recipe_scrapers/twopeasandtheirpod.py b/recipe_scrapers/twopeasandtheirpod.py index 8e4c7317c..0669e6c15 100644 --- a/recipe_scrapers/twopeasandtheirpod.py +++ b/recipe_scrapers/twopeasandtheirpod.py @@ -5,7 +5,7 @@ class TwoPeasAndTheirPod(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'twopeasandtheirpod.com' def title(self): diff --git a/recipe_scrapers/vegolosi.py b/recipe_scrapers/vegolosi.py index b63747eb9..4d23a813f 100644 --- a/recipe_scrapers/vegolosi.py +++ b/recipe_scrapers/vegolosi.py @@ -5,7 +5,7 @@ class Vegolosi(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'vegolosi.it' def title(self): diff --git a/recipe_scrapers/whatsgabycooking.py b/recipe_scrapers/whatsgabycooking.py index 1b4aa2ee1..6194f5ac7 100644 --- a/recipe_scrapers/whatsgabycooking.py +++ b/recipe_scrapers/whatsgabycooking.py @@ -5,7 +5,7 @@ class WhatsGabyCooking(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'whatsgabycooking.com' def title(self): diff --git a/recipe_scrapers/wikicookbook.py b/recipe_scrapers/wikicookbook.py index caf510c43..6d80c70d3 100644 --- a/recipe_scrapers/wikicookbook.py +++ b/recipe_scrapers/wikicookbook.py @@ -5,7 +5,7 @@ class WikiCookbook(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'en.wikibooks.org' def title(self): diff --git a/recipe_scrapers/yummly.py b/recipe_scrapers/yummly.py index a880fe20f..731aabf84 100644 --- a/recipe_scrapers/yummly.py +++ b/recipe_scrapers/yummly.py @@ -5,7 +5,7 @@ class Yummly(AbstractScraper): @classmethod - def host(self): + def host(cls): return 'yummly.com' def title(self): From 80fd5e3bc20062ffbf06386feb42924f4e16eac0 Mon Sep 17 00:00:00 2001 From: hhursev Date: Sat, 4 Jul 2020 02:13:55 +0300 Subject: [PATCH 3/4] Make class using the schema format more explicit --- recipe_scrapers/_schemaorg.py | 2 +- recipe_scrapers/acouplecooks.py | 25 +++++++++++++++---------- recipe_scrapers/allrecipes.py | 21 +++++++++++++++++++++ recipe_scrapers/archanaskitchen.py | 18 ++++++++++++++++++ recipe_scrapers/cookpad.py | 21 +++++++++++++++++++++ recipe_scrapers/cybercook.py | 21 +++++++++++++++++++++ recipe_scrapers/kochbar.py | 18 ++++++++++++++++++ recipe_scrapers/misya.py | 21 +++++++++++++++++++++ recipe_scrapers/myrecipes.py | 22 +++++++++++++++++++++- recipe_scrapers/nytimes.py | 22 +++++++++++++++++++++- recipe_scrapers/ohsheglows.py | 22 +++++++++++++++++++++- recipe_scrapers/spendwithpennies.py | 21 +++++++++++++++++++++ 12 files changed, 220 insertions(+), 14 deletions(-) diff --git a/recipe_scrapers/_schemaorg.py b/recipe_scrapers/_schemaorg.py index a7b3cd355..ef05bc96b 100644 --- a/recipe_scrapers/_schemaorg.py +++ b/recipe_scrapers/_schemaorg.py @@ -87,7 +87,7 @@ def image(self): return image[0].get('url') return image[0] - if self.host not in image: + if 'http://' not in image and 'https://' not in image: # some sites give image path relative to the domain # in cases like this handle image url with class methods or og link return '' diff --git a/recipe_scrapers/acouplecooks.py b/recipe_scrapers/acouplecooks.py index 856e3a04d..1ea101443 100644 --- a/recipe_scrapers/acouplecooks.py +++ b/recipe_scrapers/acouplecooks.py @@ -24,16 +24,21 @@ def yields(self): 'span', {'class': 'tasty-recipes-yield'}).span ) - + def ingredients(self): - return [normalize_string(child.text) for child in self.soup.find( - 'div', - {'class':'tasty-recipes-ingredients'}).ul.children] - + return [ + normalize_string(child.text) + for child in self.soup.find( + 'div', + {'class': 'tasty-recipes-ingredients'} + ).ul.children + ] + def instructions(self): - return "\n".join([instruction.text for instruction in self.soup.find( - 'div', - {'class':'tasty-recipes-instructions'}).ol.children + return "\n".join([ + instruction.text for instruction in + self.soup.find( + 'div', + {'class': 'tasty-recipes-instructions'} + ).ol.children ]) - - diff --git a/recipe_scrapers/allrecipes.py b/recipe_scrapers/allrecipes.py index 2f3d0a244..76c6a8234 100644 --- a/recipe_scrapers/allrecipes.py +++ b/recipe_scrapers/allrecipes.py @@ -6,3 +6,24 @@ class AllRecipes(AbstractScraper): @classmethod def host(cls): return 'allrecipes.com' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/archanaskitchen.py b/recipe_scrapers/archanaskitchen.py index 71c77f798..5b332e6e0 100644 --- a/recipe_scrapers/archanaskitchen.py +++ b/recipe_scrapers/archanaskitchen.py @@ -6,3 +6,21 @@ class ArchanasKitchen(AbstractScraper): @classmethod def host(cls): return 'archanaskitchen.com' + + def title(self): + return self.schema.title() + + def total_time(self): + return self.schema.total_time() + + def yields(self): + return self.schema.yields() + + def ingredients(self): + return self.schema.ingredients() + + def instructions(self): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/cookpad.py b/recipe_scrapers/cookpad.py index cf5cff043..746848460 100644 --- a/recipe_scrapers/cookpad.py +++ b/recipe_scrapers/cookpad.py @@ -6,3 +6,24 @@ class CookPad(AbstractScraper): @classmethod def host(cls): return 'cookpad.com' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/cybercook.py b/recipe_scrapers/cybercook.py index bf410c50a..29a89fff9 100644 --- a/recipe_scrapers/cybercook.py +++ b/recipe_scrapers/cybercook.py @@ -6,3 +6,24 @@ class Cybercook(AbstractScraper): @classmethod def host(cls): return 'cybercook.com.br' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/kochbar.py b/recipe_scrapers/kochbar.py index 41628f60c..162f1d564 100644 --- a/recipe_scrapers/kochbar.py +++ b/recipe_scrapers/kochbar.py @@ -6,3 +6,21 @@ class Kochbar(AbstractScraper): @classmethod def host(cls): return 'kochbar.de' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() diff --git a/recipe_scrapers/misya.py b/recipe_scrapers/misya.py index 6e4c2df2f..c6f691f43 100644 --- a/recipe_scrapers/misya.py +++ b/recipe_scrapers/misya.py @@ -6,3 +6,24 @@ class Misya(AbstractScraper): @classmethod def host(cls): return 'misya.info' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/myrecipes.py b/recipe_scrapers/myrecipes.py index b74793e6a..86dc6a5af 100644 --- a/recipe_scrapers/myrecipes.py +++ b/recipe_scrapers/myrecipes.py @@ -6,4 +6,24 @@ class MyRecipes(AbstractScraper): @classmethod def host(cls): return 'myrecipes.com' - \ No newline at end of file + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/nytimes.py b/recipe_scrapers/nytimes.py index 0eb57ea76..07b5494ae 100644 --- a/recipe_scrapers/nytimes.py +++ b/recipe_scrapers/nytimes.py @@ -6,4 +6,24 @@ class NYTimes(AbstractScraper): @classmethod def host(cls): return 'cooking.nytimes.com' - \ No newline at end of file + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/ohsheglows.py b/recipe_scrapers/ohsheglows.py index 02aa29f6f..340b34ac2 100644 --- a/recipe_scrapers/ohsheglows.py +++ b/recipe_scrapers/ohsheglows.py @@ -6,4 +6,24 @@ class OhSheGlows(AbstractScraper): @classmethod def host(cls): return 'ohsheglows.com' - \ No newline at end of file + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() diff --git a/recipe_scrapers/spendwithpennies.py b/recipe_scrapers/spendwithpennies.py index 88c702c90..a03c09117 100644 --- a/recipe_scrapers/spendwithpennies.py +++ b/recipe_scrapers/spendwithpennies.py @@ -6,3 +6,24 @@ class SpendWithPennies(AbstractScraper): @classmethod def host(cls): return 'spendwithpennies.com' + + def title(self): + return self.schema.title() + + 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): + return self.schema.instructions() + + def ratings(self): + return self.schema.ratings() From 1a64e6d03b9964911684a84a389e0de56bede84c Mon Sep 17 00:00:00 2001 From: hhursev Date: Sat, 4 Jul 2020 02:14:44 +0300 Subject: [PATCH 4/4] Bump version to 7.4.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 96eed0b1d..e38b412e8 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="recipe_scrapers", url="https://github.com/hhursev/recipe-scrapers/", - version="7.3.0", + version="7.4.0", author="Hristo Harsev", author_email="r+pypi@hharsev.com", description="Python package, scraping recipes from all over the internet",