Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////实现推特批量取消关注的功能. 使用方法:打开网页版推特,进入关注列表,F12打开检查,找到控制台,粘贴进去代码,回车运行(一次只能取关30~70,为了防止被封)
- let btns = document.querySelectorAll("[data-testid]")
- let followBtns = Array.from(btns).filter(btn => {
- return btn.getAttribute('data-testid').includes('unfollow')
- })
- for (let i = 1; i <= followBtns.length; i++) {
- followBtns[i - 1].click();
- let _span = document.getElementsByTagName('span');
- for (var j = 0; j < _span.length; j++) {
- if (_span[j].textContent == "取消关注") {
- _span[j].click();
- console.log("取关");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement