Code Monkey home page Code Monkey logo

bilibili-spyder's Introduction

bilibili-spyder

通过av号爬取B站视频评论,分析点赞量与等级的关系,评论词云

源数据获取;

数据源为B站视频评论 在加载新的一页评论时观察到访问的url

https://api.bilibili.com/x/v2/reply/main?callback=jQuery172020167562580015508_1653393655707&jsonp=jsonp&next=4&type=1&oid=768584323&mode=3&plat=1&_=1653396013955 其中 next:页数 oid:视频av号 访问时带上head可以获得评论的json文件

评论json数据结构

N4oqN.png

过程

使用的库:requests,jieba,re,pandas,matplotlib,json,csv

  1. ·from_bilibili_get_json.py·—获取评论json
  2. ·like_level.py·---根据json得到不同等级用户的被点赞量并绘制柱状图
  3. ·dejson.py·—收集所有评论到comment.txt
  4. ·词频.py·-词频分析
  5. ·keshijua.py·—可视化

Results show

点赞量与等级的关系 N4qrC.png 评论词频 N45QL.png 评论词云 N4BCi.png

bilibili-spyder's People

Contributors

2412322029 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.