DEV Community

Cover image for JavaScript Instagram Bot P2

JavaScript Instagram Bot P2

FrontEnd developer React.js/JavaScript/CSS/HTML/ Redux/JQuery/Firebase/Next.js/Git/etc. 📩𝙙𝙖𝙣𝙞𝙟𝙚𝙡𝙖𝙛𝙪𝙚𝙠𝙀@𝙮𝙖𝙝𝙀𝙀.𝙘𝙀𝙢
・1 min read

Hi, This my second JavaScript Instagram "bot", but not actually a bot 😝, just a useful piece of code used in a smart way.

The best way to gain followers on Instagram is by following others who already follow people with similar content as yours.

BTW check out my previous article about my Instagram bot for likes for better clarification

Let's begin!
Like last time, you need to log in to your Instagram account on your computer, search for the account with similar content as yours, and click on their followers. Inspect the Follow button, and see which class the button has. Now, click on the browser console, and paste this code, don't forget to add the classes of the button.

var followed = 0;
setInterval(function() {
const button = document.querySelector('button.classes');
//change classes with classes you got when inspecting the button
if(button) {;
console.log(`You followed ${followed} people`);
}, 10000);

-Keep in mind Instagram has the tendency to change the classes frequently.

P. S. Be careful, set the setInterval to at least 10-15 seconds so your account doesn't get banned 😁

You are welcome 😁

Discussion (3)

sadaca73 profile image

Hello Danijela,

I'm trying to implement this code, but it seems to be clicking the same follow button for the first instance over and over again. While the console logs that I followed however many new people it doesn't follow the 2nd account (just keeps clicking the first). I was proud that I even figured out the class thing here and get something working. Any chance you can help me figure this out?

Thanks, and BTW, I also implemented the first bot you posted about.


vaibhavkhulbe profile image
Vaibhav Khulbe

That's where frontend devs are good at! Finding DOM and using classes. 😜

Some comments have been hidden by the post's author - find out more

Forem Open with the Forem app