Digital Farmer
Digital Farmer

Reputation: 2127

Auto click like buttons on my Feed Instagram directly from Google Chrome's DevTools

The button path is:

enter image description here

The auto click I tried in the DevTools Console was:

document.querySelectorAll('svg[aria-label="Curtir"]').forEach(btn => btn.click());

The error when trying to run:

Uncaught TypeError: btn.click is not a function
    at <anonymous>:1:74
    at NodeList.forEach (<anonymous>)
    at <anonymous>:1:55

Usually on websites this model for clicks works fine, but for Instagram it's not working, what am I doing wrong so that the result is not positive?

Upvotes: 0

Views: 551

Answers (1)

Philippe
Philippe

Reputation: 1307

Maybe svg elements themselves are not clickable.

document.querySelectorAll('svg[aria-label="Curtir"]').forEach(svg => svg.closest("button").click());

should work :)

Upvotes: 1

Related Questions