autox.js腳本採集抓取抖音直播間彈幕評論

利用autox.js識別抓取抖音直播間評論彈幕信息

auto();
history={};
console.show(true);

while(true){
    listBox=className("androidx.recyclerview.widget.RecyclerView").findOne(2000);
    if(!listBox){
        continue;
    }
    allList=listBox.children();
    for (var i = 0; i < allList.length; i++) {
       
        var user = allList[i];
        if(!user) continue;
        var content = user.text();
        if(!content) continue;
        content=content.replace(/\u200E/g, '').replace(/^[\*\s]+/,"").trim();
        if(history[content]) continue;
        //打印內容
        console.log(content);
        history[content]=1;
        if(history.length>200){
            history.pop();
        }
    }
    sleep(1000);
}

 

原文地址:

https://www.uniqchat.com/54.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章