From Ingredients to Inspiration: Using Web Scraping to Find Recipes for Leftover Ingredients

CSEF · 2023 Mathematical Sciences Honorable_mention Award

Overview

Introduction: Every year, immense amounts of food is wasted. ~6 million tons of perfectly good food is thrown out in California yearly. Engineering Goal: Using Python, BeautifulSoup, Requests, and Pandas, my goal is to design a program to scrape over 100 recipes to find recipes which include a list of ingredients entered by the user. It must be accessible over many devices, allow users to enter multiple ingredients, should be free. My success criteria were as follows: 1) Able to produce results within 3 minutes with a 60% success rate, 2) Accurately produce results relating to the ingredients entered with a 70% success rate, 3) Able to successfully differentiate whether the user wants to produce results from allrecipes.com or tasty.co and provide accurate results with a 90% success rate. Process: My first prototype was only able to scrape a few recipe links found in the program and only print out the ingredients list. I revised the program to incorporate multiple links that were read from a database (.csv file) and used for loops and if statements, to produce logic to search for a certain ingredient in the ingredient list. Results: My prototype met success criteria 1, 2, and 3. The program produced results within 3 minutes with a 100% success rate, accurately produced results relating to the ingredients entered with a 80% success rate, and was able to successfully differentiate whether the user wants to produce results from a certain website with a 100% success rate. Future: In the future, I want to make the program much more efficient by synchronously parsing each of the pages, as well as add more links to the database so the program is more likely to be able to find a matching recipe that includes the ingredients entered by the user.

Source coverage

This record comes from a published award list, not a complete project archive. Its abstract comes from CSEF's public project showcase as archived by the Internet Archive before judging (https://web.archive.org/web/20230401224130/https://ca-csef.zfairs.com/showcase/ShowcaseInfo?f=838e60b7-ea75-46e8-865c-fde4864244b3); the version presented may differ.

Awards (1)

  • Category Award: HM

Competition history

  • CSEF 2023 Mathematical Sciences · Entry J1405

Resources

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: California Science & Engineering Fair public projects

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google