This is the second in a series that uses Python with impure motives. The previous (first) article also touched on Python, so if you haven't seen it yet, please take a look.
This time, SNS has a tremendous number of users all over the world including teens in Japan. I worked to fulfill the simple and clear desire to increase followers on Instagram.
For those who like Instagram
** "I have this many followers," **
With a yellow voice
"great"
I'm likely to be told.
Do you want to be told? However, my face is also cool, and it's annoying to go around the spots that look good on Instagram. .. .. ..
It is an impure motive again. It's a very simple program, but I've made it so I'll introduce it.
It took about 3 hours to make it **
I've never used selenium, but it's easy because I made it right away.
If you have the potential of a celebrity or something in the first place, you might get it by face, style or original name recognition. If you don't meet the conditions like me, you can't do it normally.
I think there are some points for such ordinary people to increase their followers. This is far from the main program,
** ・ Easy-to-understand profile design ・ Follow the post hashtag of the same attribute user and like ・ Enriched content ・ Promote mutual follow-up of the same attributes **
I think this is about the number of ordinary people.
** I also wanted proof that anyone could increase it, so I experimented with an account that I would never follow. ** **
This time, we will specialize in encouraging mutual follow-up.
Speaking of the condition that anyone can increase and the account that I would never follow?
That's right!
** It is an account that seems to sell faceless information products that are not beautiful! !! ** **
"Vending" "Rights income" Such
This is the attribute I hate the most.
We will create and operate such an account.
Python only. I will not give it to the server.
The editor is VS.
Only this
You will be happy. Click here for the actual account.
https://www.instagram.com/truthhack/
It will be a wonderful workmanship. Thank you very much. The image has pulled the photos posted by rich people overseas.
When I saw it now, my followers were a little off. If you do it continuously, it will increase a little more.
Anyone looking at this article will have what they need
** PC, editor and Instagram account. ** **
Only this.
Let's write it because it will actually be released!
The following modules are used, so if you haven't installed it, just type pip install (module name) and it will be pretty lol
filename.py
import time
from selenium import webdriver
import chromedriver_binary
from bs4 import BeautifulSoup
from selenium.webdriver.common.action_chains import ActionChains
Since you have to log in on the WEB, prepare your login ID and password and enter them to log in to your account.
filename.py
Username = 'Instagram username'
password = 'Instagram password'
#If you change the above ID and password, you can do the same with other accounts, so if you want to increase the followers of other accounts, just change the above.
If you hit the program below, Chrome will start automatically and even log in to the specified account. At this point, if you put it in your account, it's working.
filename.py
chrome_options = webdriver.ChromeOptions()
prefs = {"profile.default_content_setting_values.notifications" : 2}
chrome_options.add_experimental_option("prefs",prefs)
driver = webdriver.Chrome(chrome_options=chrome_options)
driver.implicitly_wait(10) # seconds
#Instagram URL
driver.get("https://www.instagram.com/")
#Enter necessary information such as user name here
el = driver.find_element_by_name("username")
el.send_keys(Username)
el1 = driver.find_element_by_name("password")
el1.send_keys(password)
el.submit()
Once in your account, it's time to move to your list of followers. You can click on the recommended account, but since we only recommend new accounts, there is a possibility that it is a zombie account, so go to the followers and list to follow the followers I will. ** * I will leave it to you where to transition. ** **
filename.py
try:
annual_link = driver.find_element_by_xpath('//*[@id="react-root"]/section/nav/div[2]/div/div/div[3]/div/div[5]/a')
annual_link.click()
except Exception:
oter_link = driver.find_element_by_xpath('//*[@id="react-root"]/section/nav/div[2]/div/div/div[3]/div/div[4]/a')
oter_link.click()
#Click on your followers
annual_link1 = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[3]/a')
annual_link1.click()
Let's follow the rest! If you scroll in the middle, the next button will not appear unless you scroll, so scroll it. If you change the number of the for statement, the number of followers will increase, so please change it appropriately.
filename.py
#Click at the beginning of a follower
annual_link2 = driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/ul/div/li[1]/div/div[2]/div[1]/div/div/a')
annual_link2.click()
#Click the follower of the follower
annual_link3 = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[2]/a')
annual_link3.click()
#Scroll
target = driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/ul/div/li[12]')
actions = ActionChains(driver)
actions.move_to_element(target)
actions.perform()
for iyy in range(3,50):
try:
inside = '/html/body/div[4]/div/div[2]/ul/div/li['+ str(iyy) +']/div/div[2]/button'
followButton = driver.find_element_by_xpath(inside)
followButton.click()
time.sleep(2)
except NoSuchElementException as e:
followButton1 = '/html/body/div[5]/div/div/div[3]/button[2]'
target = driver.find_element_by_xpath(followButton1)
driver.execute_script("arguments[0].click();", target)
except Exception:
continue
It's the same until you log in to your account. After that, you can rewrite it or create it in a separate file. Let's remove the last person we followed. This should be removed after a period of time. In the future, I would like to make sure that the timing of mutual follow-up is successful.
filename.py
try:
accept_link = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/div/div/div/button')
accept_link.click()
except Exception:
pass
try:
annual_link = driver.find_element_by_xpath('//*[@id="react-root"]/section/nav/div[2]/div/div/div[3]/div/div[5]/a')
annual_link.click()
except Exception:
oter_link = driver.find_element_by_xpath('//*[@id="react-root"]/section/nav/div[2]/div/div/div[3]/div/div[4]/a')
oter_link.click()
#Click on your followers
annual_link1 = driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[3]/a')
annual_link1.click()
#Scroll
target = driver.find_element_by_xpath('/html/body/div[4]/div/div[2]/ul/div/li[12]/div/div[3]/button')
actions = ActionChains(driver)
actions.move_to_element(target)
actions.perform()
for iyy in range(1,201):
followPeople = '/html/body/div[4]/div/div[2]/ul/div/li[' + str(iyy) + ']/div/div[2]/button'
annual = driver.find_element_by_xpath(followPeople)
annual.click()
time.sleep(2)
unfollow = driver.find_element_by_xpath('/html/body/div[5]/div/div/div[3]/button[1]')
unfollow.click()
time.sleep(2)
print(Username + " " + 'Done!!')
#Finally exit the driver
driver.quit()
As I mentioned earlier, I'm making another one, so I can't secure time, so it's a hassle. If you would like to work with us, please contact us. Or the same for those who want to participate in another PJ.
Other PJs are making sales support tools for toB. There are 4 people including me.
I would be grateful if you could contact me on the FB below. https://www.facebook.com/kei.nakanowatari
Recommended Posts