使用 chrome 扩展神器 web scraper 批量抓取b站排行榜数据
原文:
不会 Python 没关系,手把手教你用 web scraper 抓取豆瓣电影 top 250 和 b 站排行榜mp.weixin.qq.com/s/6UrMYkJoQGhNS_JvCZYwWA
平常想抓取数据一般想到写代码,但如果不会或者懒得写呢,可以试试chrome扩展神器 web scraper https://chrome.google.com/webstore/detail/web-scraper-free-web-scra/jnhgnonknehpejjnehehllkliplmbmhn ,不写代码也能轻松完成抓取任务,比如用 web scraper 抓取b站排行榜的视频排名,标题,播放量,弹幕数,up主,点赞数,投币数,收藏数
哔哩哔哩排行榜www.bilibili.com/v/popular/rank/all
安装后打开谷歌浏览器控制台,导入以下内容:
{"_id":"bilibili","startUrl":["https://www.bilibili.com/v/popular/rank/all"],"selectors":[{"delay":0,"id":"row","multiple":true,"parentSelectors":["_root"],"selector":"li.rank-item","type":"SelectorElement"},{"delay":0,"id":"视频排名","multiple":false,"parentSelectors":["row"],"regex":"","selector":"i.num","type":"SelectorText"},{"delay":0,"id":"视频标题","multiple":false,"parentSelectors":["row"],"regex":"","selector":"a.title","type":"SelectorText"},{"delay":0,"id":"播放量","multiple":false,"parentSelectors":["row"],"regex":"","selector":".detail-state > span:nth-of-type(1)","type":"SelectorText"},{"delay":0,"id":"弹幕数","multiple":false,"parentSelectors":["row"],"regex":"","selector":"span:nth-of-type(2)","type":"SelectorText"},{"delay":0,"id":"up主","multiple":false,"parentSelectors":["row"],"regex":"","selector":"a span","type":"SelectorText"},{"delay":0,"id":"视频链接","multiple":false,"parentSelectors":["row"],"selector":"a.title","type":"SelectorLink"},{"delay":0,"id":"点赞数","multiple":false,"parentSelectors":["视频链接"],"regex":"","selector":"span.like","type":"SelectorText"},{"delay":0,"id":"投币数","multiple":false,"parentSelectors":["视频链接"],"regex":"","selector":"span.coin","type":"SelectorText"},{"delay":0,"id":"收藏数","multiple":false,"parentSelectors":["视频链接"],"regex":"","selector":"span.collect","type":"SelectorText"}]}

然后点预览数据:

看着没问题:

点击scrape开始抓取数据,浏览器会自动打开一个窗口,不用管他:

抓取完成后的数据:

再导出excel或者csv,搞定:


还没人赞这篇日记