From f6de07eefcc95a90f3ec0c215427c699e258dc0f Mon Sep 17 00:00:00 2001
From: Joey <7505194+jknndy@users.noreply.github.com>
Date: Tue, 22 Oct 2024 16:34:55 -0400
Subject: [PATCH 1/7] implement sudobash1's recommended fix
---
recipe_scrapers/americastestkitchen.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/recipe_scrapers/americastestkitchen.py b/recipe_scrapers/americastestkitchen.py
index 589b9c952..08fdc68f9 100644
--- a/recipe_scrapers/americastestkitchen.py
+++ b/recipe_scrapers/americastestkitchen.py
@@ -71,5 +71,4 @@ def _parse_ingredient_item(ingredient_item):
@functools.cached_property
def _get_additional_details(self):
j = json.loads(self.soup.find(type="application/json").string)
- name = list(j["props"]["initialState"]["content"]["documents"])[0]
- return j["props"]["initialState"]["content"]["documents"][name]
+ return j["props"]["pageProps"]["data"]
From 7466962ed2d5291d8862547679290f771fd0efec Mon Sep 17 00:00:00 2001
From: Joey <7505194+jknndy@users.noreply.github.com>
Date: Tue, 22 Oct 2024 16:39:29 -0400
Subject: [PATCH 2/7] updated test data
---
.../americastestkitchen.json | 31 +-
.../americastestkitchen.testhtml | 6663 +++++++++--------
2 files changed, 3422 insertions(+), 3272 deletions(-)
diff --git a/tests/test_data/americastestkitchen.com/americastestkitchen.json b/tests/test_data/americastestkitchen.com/americastestkitchen.json
index fd113faaf..ee74b3170 100644
--- a/tests/test_data/americastestkitchen.com/americastestkitchen.json
+++ b/tests/test_data/americastestkitchen.com/americastestkitchen.json
@@ -72,13 +72,36 @@
],
"category": "Main Courses, Casseroles",
"yields": "8 servings",
- "description": "Could we adapt and simplify this northern Italian classic for the American kitchen?",
+ "description": "Could we adapt and simplify this northern Italian classic for the American kitchen? When we started thinking about a simple lasagna Bolognese recipe, there was no denying the appeal of no-boil noodles. After several tests, we found that a five-minute soak proved most effective for getting sturdy, al dente noodles that bound together the layers of ragu and béchamel without soaking up all the moisture. Stumbling through multiple rounds of meat sauce testing gave us the idea of combining the ragu and béchamel when both were lukewarm. The resulting sauce was thickened but easy to spread, with enough moisture for cooking the noodles in our simplified lasagna recipe.",
"total_time": 210,
"cuisine": "Europe, Italian",
"ratings": 4.4,
- "ratings_count": 80,
+ "ratings_count": 98,
"nutrients": {
- "calories": "5764 calories"
+ "calories": "721",
+ "fatContent": "40 grams",
+ "saturatedFatContent": "20 grams",
+ "unsaturatedFatContent": "14 grams",
+ "transFatContent": "1 grams",
+ "carbohydrateContent": "39 grams",
+ "sugarContent": "13 grams",
+ "proteinContent": "39 grams",
+ "sodiumContent": "1165 miligrams",
+ "cholesterolContent": "119 miligrams"
},
- "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/3801_so04-lasagnabolognes-article"
+ "image": "https://res.cloudinary.com/hksqkdlah/image/upload/ar_1:1,c_fill,dpr_2.0,f_auto,fl_lossy.progressive.strip_profile,g_faces:auto,q_auto:low,w_150/3801_so04-lasagnabolognes-article",
+ "keywords": [
+ "Main Courses",
+ "Europe",
+ "Italian",
+ "Pasta",
+ "Grains",
+ "Rice & Beans",
+ "Eggs & Dairy",
+ "Meat",
+ "Cheese",
+ "Beef",
+ "Pork",
+ "Casseroles"
+ ]
}
diff --git a/tests/test_data/americastestkitchen.com/americastestkitchen.testhtml b/tests/test_data/americastestkitchen.com/americastestkitchen.testhtml
index f698920be..28aae8941 100644
--- a/tests/test_data/americastestkitchen.com/americastestkitchen.testhtml
+++ b/tests/test_data/americastestkitchen.com/americastestkitchen.testhtml
@@ -15,3203 +15,44 @@
j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl
;
f.parentNode.insertBefore(j,f);
- })(window,document,'script','dataLayer','GTM-MFMR9K');