Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda