from selenium import webdriver
import time
username = ""
password = ""
getdriver = ("https://www.instagram.com/accounts/login/")
driver = webdriver.Chrome()
driver.get(getdriver)
driver.find_element_by_xpath("//input[@name='username']").send_keys(username)
driver.find_element_by_xpath("//input[@name='password']").send_keys(password)
driver.find_element_by_xpath("//button[contains(.,'Log in')]").click()
time.sleep(5)
driver.get("https://www.instagram.com/python.coders/followers/")
driver.find_element_by_xpath('//*[@id="react-root"]/section/main/div/header/section/ul/li[2]/a').click()
while True:
time.sleep(2)
driver.find_element_by_name('Follow').click()
我想点击Instagram上的所有关注显示按钮,我不能用标签名称或名称来做。