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

Scraper issue with Americas Test Kitchen #1466

Open
ngraber3E opened this issue Jan 13, 2025 · 2 comments
Open

Scraper issue with Americas Test Kitchen #1466

ngraber3E opened this issue Jan 13, 2025 · 2 comments
Labels

Comments

@ngraber3E
Copy link

Recipe URL with the issue:

Which data is not being scraped correctly?
Ingredients, Instructions.

Test Script

from urllib.request import urlopen

from recipe_scrapers import scrape_html

url = "https://www.americastestkitchen.com/recipes/14702-cherry-hand-pies"
html = urlopen(url).read().decode("utf-8") # retrieves the recipe webpage HTML
scraper = scrape_html(html, org_url=url)

Results

Traceback (most recent call last):
File "/app/mealie/test.py", line 7, in
scraper = scrape_html(html, org_url=url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pysetup/.venv/lib/python3.12/site-packages/recipe_scrapers/init.py", line 967, in scrape_html
return SCRAPERS[host_name](html=html, url=org_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pysetup/.venv/lib/python3.12/site-packages/recipe_scrapers/_abstract.py", line 36, in init
for name, _ in inspect.getmembers(self, inspect.ismethod):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/inspect.py", line 614, in getmembers
return _getmembers(object, predicate, getattr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/inspect.py", line 592, in _getmembers
value = getter(object, key)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 995, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/opt/pysetup/.venv/lib/python3.12/site-packages/recipe_scrapers/americastestkitchen.py", line 74, in _get_additional_details
name = list(j["props"]["initialState"]["content"]["documents"])[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^


Optional information that helps us understand our users better:

  • Which version of recipe-scrapers 15.3.3
  • What's your use case for recipe-scrapers Mealie
@ngraber3E ngraber3E added the bug label Jan 13, 2025
@ngraber3E
Copy link
Author

This might need to be confirmed but it looks like this is fixed on the main branch? I installed the main git branch with the following command.
pip install git+https://github.com/hhursev/recipe-scrapers.git

@hhursev
Copy link
Owner

hhursev commented Jan 14, 2025

Yep! Thanks for taking the extra time on this one. Seem like this was fixed by @jknndy in #1320 .

I'll bump our version to include this fix later today. Once Mealie starts using 15.4.0+ you should have no issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants