0
I’m making a bot for instagram, comes certain part of the page I have a list of people with the "follow" button on the side.
made that code:
bot = self.bot
bot.get('https://www.instagram.com/explore/people/suggested/')
time.sleep(3)
for i in range(1, 30):
time.sleep(5)
seguir = bot.find_element_by_tag_name("button")
seguir.click()
time.sleep(5)
bot.refresh()
With each click of the button "follow", the bot gives a refresh on the page, who followed it some of the page and who is in 2 place rises to 1 and so the bot clicks again. The problem is that when it reaches the 5 or 7 person, the Buga button, it no longer clicks and loops. Below is the screenshot of the list I receive:
There’s no way around that problem?
which error returns?
– Tmilitino
none. that’s the problem, when it reaches the 7 or 9 person, it starts to click, refresh and when the page reloads the same person is still there, as if it had not been followed, and then starts to stay in this loop.
– Filipe.C
there is the method
find_elements_by_tag
that returns aarray
of the elements and the iteira they in afor
– Tmilitino