22 lines
626 B
Python
22 lines
626 B
Python
import requests
|
|
from foods.sources.rscraper import (
|
|
RecipeScraperService,
|
|
)
|
|
|
|
|
|
test_urls = {
|
|
"https://cookingwithmike.com/quinoa-meatloaf/": True,
|
|
"https://www.kingarthurbaking.com/recipes/overnight-sourdough-waffles-recipe": True,
|
|
"https://dirt.fyi/article/2026/02/25-years-of-ipod-brain?src=longreads": False,
|
|
"https://tastesbetterfromscratch.com/belgian-waffles/": True,
|
|
}
|
|
|
|
for k, v in test_urls.items():
|
|
|
|
html = requests.get(k).text
|
|
print("Checking: ", k)
|
|
if v:
|
|
assert RecipeScraperService().is_recipe(html, k)
|
|
else:
|
|
assert not RecipeScraperService().is_recipe(html, k)
|