✔ Second, now, you can see his follwers, and if you didn't follow each person, button's label can be "Follow".
Otherwise, displaying "Unfollow". So your goal is to click the button of its label "Follow".
- If you can see each person with "Follow" label, at that page, press "F12" key or click "Inspect" of short menu.
- Well, and then, copy the following codes and past in the inspect bar.
let arr = document.getElementsByName('commit');
for(let i=0; i<arr.length; i++){
if(arr[i].value == "Follow"){
console.log(arr[i].value);
arr[i].click();
}
}
Press Enter key.
let elements = document.getElementsByClassName("artdeco-button artdeco-button--2 artdeco-button--full artdeco-button--secondary ember-view full-width mt2");
for (let i = 0; i < elements.length; i++) {
console.log( elements[i].querySelector('.artdeco-button__text').textContent.trim() )
if( elements[i].querySelector('.artdeco-button__text').textContent.trim() === "Follow" ){
elements[i].click()
console.log( 'Here' );
}
}