diff --git a/recipe_scrapers/mob.py b/recipe_scrapers/mob.py index 59e8d4a9f..19e41ebd8 100644 --- a/recipe_scrapers/mob.py +++ b/recipe_scrapers/mob.py @@ -1,7 +1,6 @@ import json from ._abstract import AbstractScraper -from ._exceptions import StaticValueException from ._grouping_utils import IngredientGroup @@ -17,9 +16,6 @@ def __init__(self, *args, **kwargs): def host(cls): return "mob.co.uk" - def site_name(self): - raise StaticValueException(return_value="Mob") - def author(self): chefs = self.recipe_json.get("chefs", []) return " & ".join([chef["title"] for chef in chefs]) if chefs else "Mob Team" @@ -88,4 +84,4 @@ def description(self): return self.recipe_json.get("summary", "") def ratings(self): - return self.recipe_json.get("averageRating", "") + return round(float(self.recipe_json.get("averageRating", "0")), 2) diff --git a/tests/test_data/mob.co.uk/mob_1.json b/tests/test_data/mob.co.uk/mob_1.json index 8c5e09c8c..ab4458bc4 100644 --- a/tests/test_data/mob.co.uk/mob_1.json +++ b/tests/test_data/mob.co.uk/mob_1.json @@ -1,5 +1,5 @@ { - "author": "Mob Team", + "author": "Seema Pankhania", "canonical_url": "https://www.mob.co.uk/recipes/chilli-cheese-paratha", "site_name": "Mob", "host": "mob.co.uk", @@ -54,17 +54,6 @@ "description": "This Indian snack is oozing with molten cheese and chilli garlicky goodness. They will be demolished in seconds, I can promise you that. Seema x", "total_time": 30, "cuisine": "Indian", - "ratings": "4.647", - "nutrients": { - "servingSize": "4" - }, - "image": "https://files.mob-cdn.co.uk/recipes/9K8A6392-2.jpg", - "keywords": [ - "chilli cheese paratha", - "indian cheese paratha", - "indian paratha recipe", - "cheese paratha recipe", - "chilli cheese paratha recipe", - "cheesy paratha recipe" - ] + "ratings": 4.65, + "image": "https://files.mob-cdn.co.uk/recipes/2023/11/Chilli-Cheese-Paratha.jpg" } diff --git a/tests/test_data/mob.co.uk/mob_1.testhtml b/tests/test_data/mob.co.uk/mob_1.testhtml index fe7b3b8c4..7c00a8f6d 100644 --- a/tests/test_data/mob.co.uk/mob_1.testhtml +++ b/tests/test_data/mob.co.uk/mob_1.testhtml @@ -1,13 +1,14 @@ -Mob — Chilli Cheese ParathaMob — Chilli Cheese Paratha
Chilli Cheese Paratha
This Indian snack is oozing with molten cheese and chilli garlicky goodness. They will be demolished in seconds, I can promise you that. Seema x
9 K8 A6392 2
New Feature

Add this recipe to your very own meal plan using the new Planner feature. Click the calendar icon above to try it out.

Serves
4
The Dough
200g Plain Flour
140ml Hot Water
The Filling
7 Garlic Cloves
3 Tsp Chilli Powder
Handful Of Coriander
3 Spring Onions
250g Mozzarella
250g Cheddar Cheese
Vegetable Oil
New Feature

This is a new feature exclusive to Mob+ members. It's still a work in progress, so let us know if you spot anything that doesn't look right.

+
\ No newline at end of file diff --git a/tests/test_data/mob.co.uk/mob_2.json b/tests/test_data/mob.co.uk/mob_2.json index 03c365c61..70d3367d9 100644 --- a/tests/test_data/mob.co.uk/mob_2.json +++ b/tests/test_data/mob.co.uk/mob_2.json @@ -1,6 +1,6 @@ { "author": "Christina Soteriou", - "canonical_url": "mob.co.uk", + "canonical_url": "https://www.mob.co.uk/recipes/speedy-udon-miso-noodle-soup", "site_name": "Mob", "host": "mob.co.uk", "language": "en", @@ -34,6 +34,6 @@ "description": "This noodle soup is a testament to a well-stocked cupboard. All you need is a handful of long life staples to throw this nutritious and delicious meal together.", "total_time": 15, "cuisine": "Asian-Inspired", - "ratings": "4.125", + "ratings": 4.47, "image": "https://files.mob-cdn.co.uk/recipes/2023/09/Speedy-Udon-Miso-Noodle-Soup.jpg" } diff --git a/tests/test_data/mob.co.uk/mob_2.testhtml b/tests/test_data/mob.co.uk/mob_2.testhtml index 0a0e5bda9..0b59ae7b1 100644 --- a/tests/test_data/mob.co.uk/mob_2.testhtml +++ b/tests/test_data/mob.co.uk/mob_2.testhtml @@ -1,14 +1,14 @@ -MobMob — Speedy Udon Miso Noodle Soup
\ No newline at end of file +
\ No newline at end of file