Hello, Here's a snipet that I found and modify to get input from user. Hope you like it. Please let me know if it is "pythonic" enough for you! Enjoy # SCRAPING TOOL TO GET RECIPIE SITES FROM THE INTERNET: # Documentation: https://pypi.org/project/recipe-scrapers/ from recipe_scrapers import scrape_me # give the url as a string, it can be url from any site listed below scraper = scrape_me('https://www.allrecipes.com/recipe/158968/spinach-and-feta-turkey-burgers/') # Q: What if the recipe site I want to extract information from is not listed below? # A: You can give it a try with the wild_mode option! If there is Schema/Recipe available it will work just fine. scraper = scrape_me('https://www.feastingathome.com/tomato-risotto/', wild_mode=True) scraper.title() scraper.total_time() scraper.yields() scraper.ingredients() scraper.instructions() scraper.image() scraper.host() scraper.links() scraper.nutrients() # if available scrape_dict = scraper.links() # ...
Posts
Showing posts from May, 2021