Skip to content

Baby formula inventory finder to assist those during the 2022 U.S. formula shortage.

License

Notifications You must be signed in to change notification settings

steventran619/formula-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Formula Finder

Find availability of baby formula online without any hassle!

About The Project

Purpose of this project is to help new parents find baby formula during the 2022 Baby Formula Shortage. This application scrapes several online retailers for their baby formula inventory, and sends a report to a list of email subscribers. This project has benefited me personally and a few other moms in our circle in finding formula. The focus is primarily on Store Brand Formula.

How it Works

Formula Finder can run on any OS. It just requires Python and Google Chrome to get it up and running. Formula Finder scrapes the web using Selenium, for product inventory information. Afterwards it generates an HTML report using PrettyTables. Then Formula Finder logs into an AOL email account, and sends the report out via BCC to a list of email subscribers or recipients.

Flow Diagram of How Formula Finder Works

Prerequisites

Installation

  1. Clone the repo
    git clone https://github.com/ChocolateTaco/formula-finder.git
  2. Install the requirements.txt
    pip install -r requirements.txt
  3. Replace the applicable chrome driver in the /input_files/ directory, relevant to your version of Google Chrome
  4. Sign up for an AOL Email Address
  5. In AOL Account Security settings, "Generate app password" or One Time Password (OTP)
  6. In /input_files/ directory, create "emailAlert.txt"
  7. In "emailAlert.txt" add the AOL email address and the one time password (separated by a line break). NOT the password of the account, but the One Time Password
    [email protected]
    emailsOneTimePassword
  8. In /input_files/emailSubscribers.txt, update the list of email recipients
  9. In the installation directory, run the run.py file
python3 run.py

Roadmap

  • Scrape StoreBrand Formula Online Retailers
    • Costco.com
      • Optimize search speed
    • Target.com
    • Amazon.com
    • 🛑 Kroger.com (Anti-Robot Friendly)
    • 🛑 SamsClub.com (Anti-Robot Friendly)
    • 🛑 Walmart.com (Anti-Robot Friendly)
  • Generate Report
    • Gather Product Name, Availability, Price, URL
    • Gather Last In Stock Date
    • Shorten URL
  • Email Results to list of email subscribers
    • BCC emails to an email list using AOL SMTP
    • Unsubscribe Feature
  • Create Virtual Environment
  • Automatic Scheduling

Design FAQs

Why Selenium over BeautifulSoup or Scrapy?

I wanted to learn a new stack such as Selenium. I will also be creating other web applications in the future. I liked that Selenium has options to perform web based GUI automation and testing.

Okay, what about Google Chrome over Firefox and Safari?

One of the goals was to have it be cross compatible with operating systems such as Windows, Mac, and Linux. Firefox also requires additional driver (Gecko Driver) resource that would take an extra step.

It's 2022, why are you still using AOL?

Went with AOL for the nostalgia and wide range of available email addresses. Also as of May 30, 2022, Gmail removed the "less secure" mail settings now making python's SMTPLIB incompatible. Though I believe you can still use Gmail if you sign up for an App password.

Will you be re-working Kroger, Sams Club, and Walmart ?

Maybe. For the time being those domains have strong capchas and bot protection, making it more challenging for projects like Formula Finder to scrape.

Acknowledgments

  • JimSC for the amazing Selenium lessons!

About

Baby formula inventory finder to assist those during the 2022 U.S. formula shortage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages