Instagram自动赞JavaScript BOT

时间:2019-05-03 19:48:31

标签: instagram

此代码带回错误

Uncaught TypeError: Cannot read property 'innerHTML' of null
    at doLike (<anonymous>:20:21)
    at <anonymous>:35:1
doLike @ VM1269:20
(anonymous) @ VM1269:35

它过去一直有效,我是从以下网站获得的:https://blog.joeldare.com/simple-instagram-like-bot/

    function getHeartElement() {
    var knownHeartElementNames = ["coreSpriteHeartOpen", "coreSpriteLikeHeartOpen"];
    var i = 0;
    // Loop through the known heart elements until one works
    for (i = 0; i < knownHeartElementNames.length; i++) {
        var heartElement = document.querySelector("." + knownHeartElementNames[i]);
        if (heartElement != undefined) {
            break;
        }
    }
    return heartElement;
}

function doLike() {
    var likeMax = 100;
    var likeElement = getHeartElement();
    var nextElement = document.querySelector(".coreSpriteRightPaginationArrow");
    likeCount++;
    var nextTime = Math.random() * (14000 - 4000) + 4000;
    if (likeElement.innerHTML.match("Unlike") == null) {
        likeElement.click();
        console.log(likeCount + " - liked");
    } else {
        console.log(likeCount + " - skipped");
    }
    setTimeout(function() {nextElement.click();}, 1000);
    if (likeCount < likeMax) {
        setTimeout(doLike, nextTime);
    } else {
        console.log("Nice! Time for a break.");
    }
}

var likeCount = 0;
doLike();

1 个答案:

答案 0 :(得分:0)

您可能要使用Keygram之类的工具-https://www.thekeygram.com

对我来说,吸引关注者真的很好