If you are a frequent shopper at Hannaford, you know it can be time-consuming to scroll through all available coupons and clip them manually. Hannaford offers a lot of coupons every week, some of which are exclusive to your account. However, claiming all the available deals takes a lot of time. This Ruby script automates the process of "clipping" all available coupons at Hannaford's website. It ensures you never miss out on any deals available to your account.
Before you can run this script, you'll need to have the following software and accounts set up:
-
Ruby: Ensure you have Ruby installed on your system.
-
Chrome Web Browser: Make sure you have Google Chrome installed on your computer.
-
ChromeDriver: Install ChromeDriver by running the following command if you haven't already:
brew install --cask chromedriver
-
Bundler: If you don't have Bundler installed, you can install it using:
gem install bundler
-
Hannaford Account: You need a Hannaford account with a valid email and password to log in.
-
Clone the repository to your local machine:
git clone https://github.com/fm-anderson/hannaford-clipper.git
-
Navigate to the project directory
cd hannaford-clipper
-
Create a
.env
file in the project directory and add your Hannaford login credentials as environment variables:HANNAFORD_EMAIL=your_email@example.com HANNAFORD_PASSWORD=your_password
-
Install the required Ruby gems using Bundler:
bundle install
To run the script, execute the following command in the project directory:
ruby clipper.rb
Depending on your choice, the script will either open a Chrome browser window or run in a headless mode. It logs into your Hannaford account, closes any promotional popups if they appear, loads all available coupons, and adds them to your account. Upon completion of the process, the script will automatically close the browser session.
-
If you encounter any issues related to ChromeDriver or the Chrome browser, make sure you have the latest versions installed. You can update ChromeDriver with
brew upgrade chromedriver
. -
If the script stops working due to changes in the website's structure, you may need to update the selectors in the script to match the new HTML structure.
-
You can create a new issue here.