Sitemap
Nazmuz Shakib Pranto

Nazmuz Shakib Pranto

I am Nazmuz Pranto, a Software Engineer, specializing in building fast, responsive web sites and applications to create great user experiences.

Automate Adding CVS Coupons

4 min readFeb 4, 2025

--

Background (feel free to skip)

Ok, I understand this post is kind of weird OR may not relate to everybody, but stick with me here… let me explain.

I am a Software Engineer by day and as part of my profession, I like to program or code to automate any repeatable tasks that I have to do regularly.

This is where CVS coupons come into play. I generally find myself shopping at CVS Pharmacy often and they have a program called ExtraCare. It sends you, the customer, coupons on a daily or weekly basis to show appreciation and help you save a few dollars here and there.

_Note: CVS did not pay me to write this post, I just found this useful and thought maybe, just maybe, others might find it useful._

Anyways, let’s get started.

Get Nazmuz Shakib Pranto’s stories in your inbox

Join Medium for free to get updates from this writer.

With this guide, you will no longer have to manually click on each “Send to Card” button to auto-add ExtraCare coupons for your CVS account.

Who is this for?

If all of these conditions apply to you, you might find this article useful:

  • Are you a regular customer of CVS Pharmacy?
  • Do you have ExtraCare with CVS and use coupons regularly?
  • Do you hate having to manually add coupons every day or week?

Let’s Get Started

Step 1

Open `Google Chrome` browser, go over to https://www.cvs.com/

Press enter or click to view image in full size

Step 2

Log in to your CVS account

Step 3

Once logged in, click on the “ExtraCare” link from the top navigation bar

Press enter or click to view image in full size

Step 4

Now, you should be able to see all of your coupons provided through ExtraCare (specifically for you). There are a lot of coupons here and having to manually add each one of these is a pain. THIS is the part we want to automate!

Press enter or click to view image in full size

Step 5

The first thing we want to do is scroll down to the bottom of the page. Notice, more and more coupons are being loaded as you scroll to the bottom. Keep scrolling until no more coupons are loaded.

Press enter or click to view image in full size

Step 6

Ok, now, `right click` anywhere on the page and click on “Inspect” from the menu

Step 7

This will open up a whole new section on the right side or the bottom of the page.

Press enter or click to view image in full size

Step 8

Inside the sidebar, click on “Console” from the top menu

Press enter or click to view image in full size

Step 9

Now, copy over this piece of code and paste it right after the `>` sign

(function run() {
const coupons = Array.from(document.querySelectorAll('send-to-card-action'))
.map(e => e.querySelector('.coupon-container .coupon-action.sc-send-to-card-action'))
.filter(Boolean);
const totalCoupons = coupons.length;

console.log(`🛍️ Total coupons to add: ${totalCoupons}`);

coupons.forEach((e, index) => {
setTimeout(() => {
e.click();
const couponsLeft = totalCoupons - index - 1;
console.log(`✨ Coupon added… ${couponsLeft} more left! ✨`);
if (couponsLeft === 0) {
console.log("🎉 All coupons have been added to your card. Enjoy your savings! 🎉");
}
}, index * 350);
});

if (totalCoupons === 0) {
console.log("🎉 All coupons have been added to your card. Enjoy your savings! 🎉");
}
})();

Step 10

Then, press `ENTER` and watch some magic happen in the background. Notice all the coupons being automatically clicked and added for you.

Press enter or click to view image in full size

Step 11

You should see a “Coupons left” counter on the sidebar, it tracks the number of coupons still to be added. Wait until that counter goes all the way down to 0.

Press enter or click to view image in full size

Step 12

That’s it, now all the coupons should be added to your account 🚀

Now, I understand that this is not a fully automated system, but it should at least help you avoid having to click on more than 100+ coupons regularly. Let me know if you found this helpful at all. I am planning to build on top of this automation to not have to manually follow all these 12 steps, so hopefully, then, it would be even simpler.

--

--