Merhaba ben basit şekilde Selenium kullanarak İnstagram takibi bırakma botu yazmak istiyorum. Yazarken bir yerde takıldım. Şöyle şimdi instagrama giriş yaparak takipçi bırak sekmesine kadar gelebildim ve ilk takipçiyi bırakabildim. Lakin alt satıra yani diğer takip eden kişiyinin üzerine nasıl geleceğimi çözemedim. Bu konuda yardımcı olurmusunuz.
code:
from selenium import webdriver
import wget
import time
import os
import zipfile
linux = ‘Link sınırı’
mac = ‘https://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip’
windows = ‘https://chromedriver.storage.googleapis.com/2.35/chromedriver_win32.zip’
def installDriver():
print(""""
[1] Linux
[2] Mac
[3] Windows
""")
selectSystem = input("Please Select Your System :")
if selectSystem == "1":
downloadUrl = wget.download(linux)
print(downloadUrl)
Zip = zipfile.ZipFile('chromedriver_linux64.zip')
Zip.extractall()
time.sleep(3)
start()
elif selectSystem == "2":
downloadUrl = wget.download(mac)
print(downloadUrl)
Zip = zipfile.ZipFile('chromedriver_mac64.zip')
Zip.extractall()
time.sleep(3)
start()
elif selectSystem == "3":
downloadUrl = wget.download(windows)
print(downloadUrl)
Zip = zipfile.ZipFile('chromedriver_win32.zip')
Zip.extractall()
time.sleep(3)
start()
def start():
nowFound = os.getcwd()
driver_path = nowFound + “\” + “chromedriver.exe”
browser = webdriver.Chrome(executable_path=driver_path)
InstagramUser = "test"
InstagramPassword = "test."
url = "https://instagram.com"
browser.get(url)
time.sleep(5)
username = "username"
password = "password"
usernameSelect = browser.find_element_by_name(username)
passwordSelect = browser.find_element_by_name(password)
usernameSelect.send_keys(InstagramUser)
passwordSelect.send_keys(InstagramPassword)
signinXpath = '//*[@id="react-root"]/section/main/article/div[2]/div[1]/div/form/div[4]/button/div'
login = browser.find_element_by_xpath(signinXpath)
login.click()
time.sleep(5)
notNowXpath = '/html/body/div[4]/div/div/div[3]/button[2]'
notNow = browser.find_element_by_xpath(notNowXpath)
notNow.click()
time.sleep(1)
bioXpath = '//*[@id="react-root"]/section/main/section/div[3]/div[1]/div/div[2]/div[1]/a'
goBio = browser.find_element_by_xpath(bioXpath)
goBio.click()
time.sleep(1)
followXpath = '//*[@id="react-root"]/section/main/div/header/section/ul/li[3]/a'
openFollow = browser.find_element_by_xpath(followXpath)
openFollow.click()
time.sleep(1)
verb = "button"
followbutton = browser.find_element_by_name(verb)
followbutton.click()
print("""
[1] Start
[2] İnstall
""")
selectFunction = input("Please Enter Select Function : ")
if selectFunction == “2”:
installDriver()
elif selectFunction == “1”:
start()