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

posted @ 2024-05-13 15:17  唯一客服系统开发笔记  阅读(245)  评论(0编辑  收藏  举报