-
Notifications
You must be signed in to change notification settings - Fork 4
/
insta-booster.py
69 lines (53 loc) · 1.98 KB
/
insta-booster.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from splinter.browser import Browser
import time, sys
#browser = Browser('chrome') # Selenium Standalone on your local machine
browser = Browser(driver_name="remote", # Docker Selenium Standalone
url='http://127.0.0.1:4444/wd/hub',
browser='chrome')
url = "https://www.instagram.com/accounts/login/"
fam = ['beyonce', 'cristiano', 'selenagomez', 'arianagrande', 'kimkardashian', 'therock']
def signIn():
browser.visit(url)
browser.find_by_name('username').fill('<username>')
browser.find_by_name('password').fill('<password>')
browser.find_by_text('Log In').click()
browser.is_text_present('Not Now', wait_time=10)
browser.find_by_text('Not Now').first.click()
def follow():
for i in fam:
browser.visit("https://www.instagram.com/" + i)
browser.is_text_present('Follow', wait_time=10)
browser.find_by_text('Follow').first.click()
browser.is_text_present('Following', wait_time=10)
def unfollow():
for i in fam:
browser.visit("https://www.instagram.com/" + i)
browser.is_text_present('Following', wait_time=10)
browser.find_by_text('Following').first.click()
browser.is_text_present('Unfollow', wait_time=10)
browser.find_by_text('Unfollow').first.click()
browser.is_text_present('Follow', wait_time=10)
def checkFams():
for i in fam:
browser.visit("https://www.instagram.com/" + i)
if browser.is_text_present('Following', wait_time=3):
browser.find_by_text('Following').first.click()
browser.is_text_present('Unfollow', wait_time=10)
browser.find_by_text('Unfollow').first.click()
browser.is_text_present('Follow', wait_time=10)
print ("Check Fams has been done !!")
signIn()
checkFams()
a=0
while True:
follow()
time.sleep(15)
print (str(a+1) + "." + " Follow Cycle Over")
unfollow()
time.sleep(15)
print (str(a+1) + "." + " Unfollow Cycle Over")
a += 1
if a == 3: # The count of how many time you want to follow/unfollow popular people.
browser.quit()
print ("Follow/Unfollow loops have been done!")
sys.exit(0)