Save over $1,000 on your groceries with 1 line of code

Muggle-born
3 min readJun 16, 2022
Lifetime savings for Safeway rewards, totaling $1,059.12

Rewards programs (AKA Loyalty Programs) are a fascinating, yet simple concept. Companies will let you sign-up for free with an email, track the money you spend at their store, and then the company will reward you with discounts and an artificial currency. Essentially, you decide to shop with one business instead of many businesses, and in exchange you are rewarded with cheaper prices and an occasional free item — I do enjoy my free cheesy jalapeño bagels.

I like to thing rewards programs are a mutual transaction, where both parties (me and the company) benefit equally as much, but in reality the company is probably benefiting a lot more than me. After all, I’m only getting 40¢ off a carton of eggs when the company has: enticed me to buy groceries at their store week after week, and learned a whole lot more about my purchasing habits. Nevertheless, I can’t ignore cheaper groceries.

How Safeway Rewards Work

I wish I would have known about this in College…

Approximately every week, Safeway (my grocery store) offers your account various coupons. Sometimes these deals are great and you can save a lot of money, for example “$20 off, when you spend over $100”. Other times the deals are not so great, for example “$1.00 off Grillo’s Pickles” and you don’t end up saving any money. To be honest I’m not much of pickle fan and will probably never use that coupon because I won’t be buying pickles.

Safeway reward coupons that I can clip. For example, “Mission Large Flour Tortillas for $4.61 each”.

After joining the rewards program, I quickly realized there were a bunch of coupons that I would not use. The problem is that are over 300 coupons added weekly and I really didn’t want to scroll through 300 coupons each week, reading each and every one of them, asking myself, “will I use this?” or “should I clip this coupon?”

you may see where I am going with this

I thought to myself: “why don’t I just automate the process of clipping all 300 coupons, then I don’t have to think about anything. All the coupons will be clipped for me and then I’ll get deals on any items in my cart that I have a coupon for when I checkout at the grocery store.”

How I Automatically Clip Coupons

Follow the steps below to quickly clip all the coupons on Safeway’s website.

  1. Login to https://www.safeway.com/foru/coupons-deals.html
  2. Continue scrolling to the bottom of the page and clicking the “Load more” button until all the coupons are loaded on the page
  3. Open up the “console” in chrome developer tools CMD + OPTION + J
  4. Copy and paste the code below into the console and press ENTER
document.querySelectorAll('.grid-coupon-btn')
.forEach((btn) => { btn.click(); })
The “console” in the chrome developer tools after running the code in step four
Safeway reward coupons that I clipped. For example, “Mission Large Flour Tortillas for $4.61 each”.

👋 That’s all you have to do, the code in step four will find and clip all the coupons on the webpage for you. Enjoy your discounts! 🛒

--

--

Muggle-born

Hi, my name is Jeremiah. I build things on the web for fun. I enjoy figuring how and why things work the way they do, and I try teaching others along the way.