do you have any idea why it unfollow only 15 people instead of all?
You need an account at Instagram to run this script.
for example:
if your account is chrome1
than this script will be working on
https://www.instagram.com/chrome1/following/
for ns in driver.find_elements_by_class_name("_6jvgy"):
try:
ns.find_element_by_class_name("_r4e4p").click() # unFollow button!!!
# time.sleep(2) # the same as without sleep
unfollow_nick = ns.find_element_by_class_name("notranslate").get_attribute("title")
print(unfollow_nick) # now: prints all, but really unfollow only 15.
except:
pass
this question is a continuation of the previous: Scroll in Selenium Webdriver (Python)
all the code needed to run: https://ideone.com/wYjHW4