Piyush Lalwani
Piyush Lalwani

Reputation: 1

How to Click a follow button on instagram dynamically using javascript from followers list of any other?

I tried this on console. But its not working. I want to click the follow button dynamically by my javascript code. I know that I can use InstPy. But I want develop my code.

Code:

First open the follower list of any account on instagram and then run this code.

var list=document.querySelectorAll(".PZuss li")<br>
list[2].getElementsByTagName('button')[0].click()

Output = undefined

What should I do so that my function start following the account when the program is executed.

Upvotes: 0

Views: 1501

Answers (1)

Arttu Pennanen
Arttu Pennanen

Reputation: 53

So what are you trying to accomplish? Follow the 3rd user of the follower list?

For me document.querySelectorAll(".PZuss li")[2].querySelector('button').click() works just fine.

Upvotes: 1

Related Questions