Prova con questo codice. L'ho fatto adesso...:Sono un ritardato ahah.
Il tasto Follow solo non funziona.
L'ultima stringa.
Python:
import time
from selenium import webdriver
def main():
driver_path = r"<path_chromedriver>"
browser = webdriver.Chrome(executable_path=driver_path)
browser.get("https://www.instagram.com/accounts/login/")
time.sleep(2)
print("Accesso in corso....")
current_url = browser.current_url
username = browser.find_element_by_name("username").send_keys("<username>")
password = browser.find_element_by_name("password").send_keys("<passowrd>")
accedi = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/article/div/div[1]/div/form/span/button').click()
time.sleep(2)
print("Cerco l'utente....")
browser.get("https://www.instagram.com/<utente_da_seguire>/")
time.sleep(2)
segui = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/div[1]/span/span[1]/button').click()
if __name__ == "__main__":
main()
Modifica le parti racchiuse tra "< .... >"