对抖音App评论进行抓取

对抖音某条视频下所有评论内容进行抓取

直接上代码

import json

def response(flow):

    # 通过抓包软包软件获取请求的接口
    if '/aweme/v2/comment/list' in flow.request.url:
        # 数据的解析
        data = json.loads(flow.response.text)
        comments = data['comments']
        for comment in comments:
            comment = comment['text']
            dict = {
                '评论':comment
            }
            print(dict)

最后 直接在终端运行py脚本,获取数据

结果展示

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/shadowtalon/article/details/107976507