Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredient grouping support for tastesoflizzyt #1326

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions recipe_scrapers/tastesoflizzyt.py
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 TastesOfLizzyT(AbstractScraper):
@classmethod
def host(cls):
return "tastesoflizzyt.com"

def ingredient_groups(self):
return group_ingredients(
self.ingredients(),
self.soup,
".wprm-recipe-group-name",
".wprm-recipe-ingredient",
)

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions tests/test_data/tastesoflizzyt.com/tastesoflizzyt_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"author": "Julie Clark",
"canonical_url": "https://www.tastesoflizzyt.com/how-to-cook-pork-steak/",
"site_name": "Tastes of Lizzy T",
"host": "tastesoflizzyt.com",
"language": "en-US",
"title": "How to Cook Pork Steaks",
"ingredients": [
"4 bone-in pork shoulder steaks (about 3 pounds)",
"1 teaspoon salt",
"1 teaspoon black pepper",
"1/2 cup salted butter (4 ounces, room temperature)",
"1 teaspoon minced garlic",
"1/4 teaspoon salt",
"2 tablespoons snipped fresh chives"
],
"ingredient_groups": [
{
"ingredients": [
"4 bone-in pork shoulder steaks (about 3 pounds)",
"1 teaspoon salt",
"1 teaspoon black pepper"
],
"purpose": "For the pork steaks:"
},
{
"ingredients": [
"1/2 cup salted butter (4 ounces, room temperature)",
"1 teaspoon minced garlic",
"1/4 teaspoon salt",
"2 tablespoons snipped fresh chives"
],
"purpose": "For the garlic chive butter:"
}
],
"instructions_list": [
"Allow the pork steaks to rest at room temperature 30 minutes before cooking if possible. Season with salt and pepper and set aside.",
"Make the garlic chive butter:",
"In a medium bowl, use a hand mixer to blend the room temperature butter, garlic, salt and chives until smooth and creamy. Set aside.",
"To grill the steaks:",
"Preheat a grill to 400ºF. Place the steaks on the grill and cook for 3-4 minutes on the first side, then flip and grill for another 3-4 minutes on the other side. (a total of 6-8 minutes for a 1/2\" steak. See guide in notes for other thicknesses). The internal temperature should reach 145ºF.",
"To pan fry the steaks:",
"Add two tablespoons of oil to a large skillet and preheat over medium-high heat.",
"Once the skillet is hot, sear the pork steaks on each side until browned, then reduce the heat to medium and continue cooking until they reach an internal temperature of 145°F. This should take a total of 6-8 minutes for a 1/2\" steak.",
"Add the garlic chive butter:",
"As soon as the steaks come off the grill or out of the skillet, gently spread or scoop the garlic chive butter on top of the steaks. Allow the steaks to rest for 4-5 minutes while the butter melts over the steaks."
],
"category": "Main Dish",
"yields": "4 servings",
"description": "Learn how to cook pork steak perfectly, both in the oven and on the grill. Top with homemade garlic chive butter while the steak rests.",
"total_time": 22,
"cook_time": 12,
"prep_time": 10,
"cuisine": "American",
"ratings": 5.0,
"ratings_count": 2,
"nutrients": {
"servingSize": "1 serving",
"calories": "207 kcal",
"fatContent": "23 g",
"saturatedFatContent": "15 g",
"unsaturatedFatContent": "7 g",
"transFatContent": "1 g",
"carbohydrateContent": "1 g",
"sugarContent": "0.03 g",
"proteinContent": "1 g",
"sodiumContent": "910 mg",
"fiberContent": "0.1 g",
"cholesterolContent": "62 mg"
},
"image": "https://www.tastesoflizzyt.com/wp-content/uploads/2024/08/how-to-cook-pork-steak-6.jpg",
"keywords": [
"grilling recipes",
"how to cook pork",
"pork steak"
]
}
1,826 changes: 1,826 additions & 0 deletions tests/test_data/tastesoflizzyt.com/tastesoflizzyt_2.testhtml

Large diffs are not rendered by default.

Loading