Making an Instagram bot

*UPDATE: I don't have instagram anymore*.

I made this “bot” because I was supposed to learn some python before taking a uni course, and I figured this would be a nice way to do it.

It’s basically a bot that goes around the web version of the Instagram app and starts “liking” some content to get you a few followers and likes.

Without further ado. Let’s get into it and see how I made this bot and how you can easily do it too.

As I said at the beginning, you’ll need to use python for this project. 

If you don’t have it feel free to check other tutorials on how to install it.

After that, the first thing we want to do is to install selenium.

This will be used to help us automatically navigate the Instagram page.

Selenium Documentation: http://selenium-python.readthedocs.io/

This is what we do to install it: 

-open the terminal

-run: $ pip install selenium

In addition to this, we also need geckodriver for your web browser to run the bot. In my case, I used the firefox one.

Gecodriver: https://github.com/mozilla/geckodriver/releases

Once you’ve downloaded “Geckodriver” from “GitHub”, you want to find it in the download folder.

Once you find it, you want to move it out of that folder to your desktop and unzip it.

Head over to your terminal

From the terminal cd into the directory of the geckodriver and type in: $ move geckodriver /user/bin

Now, all the requirements should be installed, so let’s take a look and how I wrote the code because the only thing left is running it.

Firstly, we have some imports…

imports

We want to have 'username' and 'password' as fields to use for logging in.

Then we navigate to the Instagram page and login with those credentials that will be asked from the user later in the code. We will also randomly select a hashtag to like pictures under that hashtag.

Here is where we ask the user for credentials and also where we enter our desired hashtags. 



And that’s pretty much it. Now you just need to run it and wait for the magic to happen. 

A link to the code can be found here on my GitHub repo.