A small python bot/ set of scripts that automates the process of login in to IG via facebook . Send follow requests from the suggestions tab . Unfollow people . Download pictures from a given public profile
- Install
pip install selenium
- Download
Get your chrome driver from this website :
๐ ChromeDriver ๐
If you're using windows , you may want to put the .exe in the same folder as the script.
If you're using macOs , just move it to /usr/local/bin
I haven't tested it on linux, but i bet it's the same as macOs ...
Functionalities implemented so far :
LOGIN โ๏ธ
FOllOW โ๏ธ
UNFOLLOW โ๏ธ
DOWNLOAD POSTS โ๏ธ
Follow How it works & possible optimisation :
The logic i used is :
The script opens up the 'ALL SUGGESTIONS TAB' then loads few of those suggestions
Then goes through the first 30 accounts and follows them.
Once it's done , it refreshes the page then repeat.
It won't stop until you stop the script .
You can optimise this by changing the number , i think a full page loaded displays up to 140 profiles.
if(x == 30):
self.driver.refresh()
ZTF.follow(self)
Unfollow How it works & possible optimisation :
Basicaly just like the follow part
I only unfollow 11 at a time , for some reason, if higher it results in a crash.
You can optimise this by changing the number.
BUT you need to figure out a way to scroll through everything
if(K == 11):
closemod = self.driver.find_element_by_xpath('/html/body/div[4]/div/div[1]/div/div[2]/button')
closemod.click()
ZTF.mylist(self)
Download Posts (pics only)
Given a profile , the script will acces it , load up the first 32 posts , get their links .
Then download the pictures .
There's a margin of error here , since some posts disapear from the code when they leave the view.
That's why i'm only able to grab the 32 first ones.
Credentials
As any other file containing sensitive data, credentials.py contains :
login = 'PHONE_EMAIL_OR_USERNAME'
pwd = 'PASSWORD'
profile ='elonmusk'
Make sure to change that .
The script bugs out from time to time depending on your internet speed .
The quality is shit , i made this while learning so excuse my n00bish mistakes .
The function SLEEP() , has high intervals because of my 3rd world internet , ๐ 4mbps ๐ .
You should adapt it to your needs .
Any help improving this and adding more stuff is welcome ! .
you can contact me at [email protected] or via my portfolio
๐คZ-foll released under the MIT License.
Made with ๐ by a ๐จโ๐ป on a ๐ป | 2020 | ZTF666