这是一个爬取网易云音乐的所有的歌曲的评论数的爬虫。
以下为主要思路:
- 爬取所有的歌手信息(artists.py);
- 根据上一步爬取到的歌手信息去爬取所有的专辑信息(album_by _artist.py);
- 根据专辑信息爬取所有的歌曲信息(music_by _album.py);
- 根据歌曲信息爬取其评论条数(comments_by _music.py)
- 数据库相关的语句都存放于(sql.py)中。
爬取网易云音乐所有歌曲的评论数
License: GNU General Public License v3.0
这是一个爬取网易云音乐的所有的歌曲的评论数的爬虫。
以下为主要思路:
你好,我不太了解python,只运行过简单python脚本,我看这个项目没有main.py,我找不到项目启动的入口,请问这个项目应该如何运行起来。
music_by_album.py
第21行 : R'eferer' 似乎应该是 'Referer'
照大神这么个写法并不能获取到每首歌所有的评论吧
你好,我是爬虫的初学者,下载了你的源码,直接F5了 artists.py,显示:
from music_163 import sql ImportError: No module named music_163
请教下这个是什么原因?
我是python 2.7.13 on win32.
你好,请问你爬取评论数时你的这两个参数
data = { 'params': 'Ak2s0LoP1GRJYqE3XxJUZVYK9uPEXSTttmAS+8uVLnYRoUt/Xgqdrt/13nr6OYhi75QSTlQ9FcZaWElIwE+oz9qXAu87t2DHj6Auu+2yBJDr+arG+irBbjIvKJGfjgBac+kSm2ePwf4rfuHSKVgQu1cYMdqFVnB+ojBsWopHcexbvLylDIMPulPljAWK6MR8', 'encSecKey': '8c85d1b6f53bfebaf5258d171f3526c06980cbcaf490d759eac82145ee27198297c152dd95e7ea0f08cfb7281588cdab305946e01b9d84f0b49700f9c2eb6eeced8624b16ce378bccd24341b1b5ad3d84ebd707dbbd18a4f01c2a007cd47de32f28ca395c9715afa134ed9ee321caa7f28ec82b94307d75144f6b5b134a9ce1a' }
对于每一首歌都是不变的么?
comments_by_music.py 文件里面的
127.0.0.1:10800
是什么代理呢?不用可以吗?
歌曲连接是https://music.163.com/#/artist?id=1203045 为什么在album_by _artist.py 脚本中改成https://music.163.com/artist/album 参数中limit 怎么看的
有一个问题,亲!在artists.py中:
params = {'id':group_id, 'initial':initial},这两个参数是做什么的?
还有你的headers定义了为什么没有在requests当中使用?
我的body有问题,导致后面的hot_artists和artist都是空值。
我换了好几个requests(url)中的URL,结果返回的soup还是有问题。应该还是上面两个params我没理解到是什么意思而导致后面错误。
这个连接本地或者远程MySQL是要提前把sql.py中的表先建好吗?
你好,我的artists已经可以正常抓取并且存放到数据库中,但是第二步抓取album_by_artist,虽然程序运行了很长时间但是最终数据库还是空的。
我用的数据库是MySQL 5.7
Python 3.6
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.