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
Resources
Related projects
CSEF · 2016
TrackBar: Tracking Food Expiration to Reduce Wastage
ISEF · 2017
The Development of an Algorithm through the Assessment of Nutrients in a Recycled Food Supplement for Canines to Reduce Waste Production
ISEF · 2015
Leftovers to Livestock: Turning Leftover Human Food Waste into Feed for Livestock with Consistent Nutrient Values
CSEF · 2026
The Shelf Scanner
CSEF · 2017
Fighting Malnutrition: Automated Optimization of Nutrition Using a Novel n-Dimensional Linear Programming Algorithm
CSEF · 2019
Using Machine Learning to Identify and Sort Waste
ISEF · 2021
The SLED (Shelf Life Expiration Date) Tracking System: Combating Food Waste and Food Borne Illnesses from Expiration Using Machine Learning
ISEF · 2022
Sustainability Scanner: Empowering Consumers To Make Eco-Friendly Grocery Purchases
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects