Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Selenium is unfollowing just 12 accounts after that stops the procces

I made a bot for instagram using selenium. This bot should unfollow the accounts that i follow. It works just for the first 12 accounts! After that it stops! Why this happend? i tried to use try and except ! In except i ve made a scroll function but it didn t worked! Here s my code:

fBody  = driver.find_element_by_xpath("//div[@class='isgrP']")
buttons = driver.find_elements_by_xpath("//button[contains(.,'Following')]")
for btn in range(len(buttons)):
        try:
        # Use the Java script to click on follow because after the scroll down the buttons will be un clickeable unless you go to it's location
            driver.find_element_by_xpath("//button[contains(.,'Following')]").click()
            #driver.execute_script("arguments[0].click();", btn)
            sleep(2)
            driver.find_element_by_xpath('//button[@class="aOOlW -Cab_   "]').click()
            sleep(5)
        except:
            print("Eroare")
        else:
           
            driver.execute_script('arguments[0].scrollTop = arguments[0].scrollTop + arguments[0].offsetHeight;', fBody)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!