title: Python Selenium Automatic Follow Instagram
body: <p>This script doesn't follow on Instagram why?</p>
  
  <pre><code>import time
  from time import sleep
  from selenium import webdriver
  from selenium.webdriver.common.action_chains import ActionChains
  from selenium.webdriver.common.keys import Keys
  
  browser = webdriver.Chrome('./chromedriver')
  "GO INSTAGRAM PAGE FOR LOGIN"
  browser.get('https://www.instagram.com/accounts/login/?hl=it')
  
  sleep(2)
  "ID AND PASSWORD"
  elem = browser.find_element_by_name("username").send_keys('id')
  elem = browser.find_element_by_name("password").send_keys('password')
  "CLICK BUTTON AND OPEN INSTAGRAM"
  
  good_elem = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/article/div/div[1]/div/form/span/button').click()
  
  sleep(2)
  browser.get("https://www.instagram.com")
  
  "GO TO PAGE FOR FOLLOW"
  browser.get("https://www.instagram.com/test/")  
  time.sleep(30)  
  "FOLLOW (DON'T WORK)"
  
  follow = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/div[1]/span/span[1]/button').click()
  </code></pre>