Home > front end >  Auto click like buttons on my Feed Instagram directly from Google Chrome's DevTools
Auto click like buttons on my Feed Instagram directly from Google Chrome's DevTools

Time:10-05

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?

CodePudding user response:

Maybe svg elements themselves are not clickable.

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

should work :)

  • Related