I am working on developing a JavaScript script that will automatically click on all the LIKE buttons for posts loaded on Facebook in the Chrome browser.
Input: "" Or any other FB page,Groups,Profiles
Step1: I will scroll down to load all the posts
Step 2: Identify LIKE buttons and trigger a click event
LikeButtons = document.getElementsByClassName('_48-k UFILikeLink');
for(var i = 0 ; i < LikeButtons.length ; i++){
LikeButtons[i].click();
}
The issue is that the default behavior of a CLICK() method toggles the LIKE status. This means that if a post is already LIKED, it will be UNLIKED and vice versa.
Therefore, I need to determine the current status (like/unlike) of the button before triggering the click() method.
Is there a way to discover what other methods are available for the LIKE button? *I have attempted isClick() and isLiked() as potential methods, but they did not work