-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Scraper issue with allrecipes.com #1481
Comments
Hi @jachkoune , I'm unable to replicate your issue, could you check what version you're using and provide a full copy of your terminal output? Output from my run>>> from urllib.request import urlopen
>>> from recipe_scrapers import scrape_html
>>> url = "https://www.allrecipes.com/recipe/100814/authentic-thai-coc\onut-soup/"
>>> html = urlopen(url).read().decode("utf-8")
>>> scraper = scrape_html(html, org_url=url)
>>> print(scraper.title())
Authentic Thai Coconut Soup
>>> print(scraper.ingredients())
['1 pound medium shrimp - peeled and deveined', '2 (13.5 ounce) cans canned coconut milk', '2 cups water', '1 (1 inch) piece galangal, thinly sliced', '4 stalks lemon grass, bruised and chopped', '10 makrut lime leaves, torn in half', '1 pound shiitake mushrooms, sliced', '¼ cup lime juice', '3 tablespoons fish sauce', '¼ cup brown sugar', '1 teaspoon curry powder', '1 tablespoon green onion, thinly sliced', '1 teaspoon dried red pepper flakes'] |
the issue appear when using i tested with below code its working well but some website doesn't accept connect using urlopen library
using REQUEST LIBRARY i get doubled ingredients:
using URLOPEN library i get: |
Recipe URL with the issue:
Which data is not being scraped correctly?
(e.g. ingredients, instructions, etc):
Ingredients
What should be shown instead?
it duplicate the ingredients list twice on allrecipes recipes below is a sample:
['1 pound medium shrimp - peeled and deveined', '2 (13.5 ounce) cans canned coconut milk', '2 cups water', '1 (1 inch) piece galangal, thinly sliced', '4 stalks lemon grass, bruised and chopped', '10 makrut lime leaves, torn in half', '1 pound shiitake mushrooms, sliced', '¼ cup lime juice', '3 tablespoons fish sauce', '¼ cup brown sugar', '1 teaspoon curry powder', '1 tablespoon green onion, thinly sliced', '1 teaspoon dried red pepper flakes', '1 pound medium shrimp - peeled and deveined', '2 (13.5 ounce) cans canned coconut milk', '2 cups water', '1 (1 inch) piece galangal, thinly sliced', '4 stalks lemon grass, bruised and chopped', '10 makrut lime leaves, torn in half', '1 pound shiitake mushrooms, sliced', '¼ cup lime juice', '3 tablespoons fish sauce', '¼ cup brown sugar', '1 teaspoon curry powder', '1 tablespoon green onion, thinly sliced', '1 teaspoon dried red pepper flakes']
Optional information that helps us understand our users better:
Feel free to delete this section.
The text was updated successfully, but these errors were encountered: