当前位置:网站首页>Request + BS4 crawl Netease cloud music popular comments
Request + BS4 crawl Netease cloud music popular comments
2022-07-05 13:49:00 【Weichi Begonia】
""" Get comments in Netease cloud music """
import requests
from bs4 import BeautifulSoup
import json
def comment():
url = r'https://music.163.com/weapi/comment/resource/comments/get?csrf_token='
headers = {
'user - agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36",
'referer': 'https://music.163.com/song?id=1811921555',
}
# parameters = 'CW2crKgKlxrE4bJRpb8KefG82zLZEJE7SIVqHgJg7wHotQGWl1odj4FUeMSslCdH7g5bfqA++14i4/q4TRUQ4K36QRsGnB8Nai7bjK9mduGPxv3YFV08dOnqpI6rqUqS8gqcY6nLQ0kAbGIUlqgCnocNI/0VnvfL34U+tpYpaSwyjwdYcK5bM56mxmYw80r2BZohvIre17L67OYyAFOn241rdWpy5YNmE9rAupkIvMNr+raT/f0vXwZsV7jtV9U9tQBH6p5MDAG9vSXxmX97uxkiSyDDs/a+uMTNFBGN18o='
# encSecKey = '7d3220e84f6ae4e61e08821e3c01402b5ef5edc3453fa745e60b64b01038cfa548947a986aac93bad5d3aa3686c7df8bdb9832fcd92c9e61a739af55ee2526c29eeb36ff31ebffb6518615ced8503677c9c70a90a1ee74bed2a50ba904a6c9bac0808494355529cd769107a755dee062b8f2762c2c5e79a85ebf1b2f4e19069a'
parameters = 'bQ1tMSU5UTHHPPdZRkehTbr2xBLAfPbU0UZGGzuI6EAyg4g8cQ1kgjkpsyPaTuOhyfPlPC8cnqbT8JwDldiQXkBwBtnIA/TyoFJdI96Jxsh3Ak9MCJfyZdWM67EVPuvSn8/2hpjy3IFjxkn3aSyrRDAFMogDgspod39SAP68bQ+KS1gGTQWcC9T7D1CvsNdUepsje/qvmHCY5muQCeIsKlORQKuw9xWwi+qVGbPaUUpMaaGHDSXGUJJGUhDEE8lcWrgGPrmDqk0Ni0W8X2viFBkbA67t3vb2lpnWH94Efkg='
encSecKey = "1a7087e4d24a4a8e6ffe3715333bc9d040df60c611afda428437a6402d30b9ccc11b367c72c38c62705f556546b657e4c207757b10a806d27bfa681a6f1199427519b8ee0af9e748c7cf9d072a315eb65dd79d9500b1905e55480c1145dea2c1b9179ef6e5fbba9d1612abd3815c8fd7ecac40d3d52406c6c81dd494088eab2b"
data = {
'params': parameters,
"encSecKey": encSecKey,
}
res = requests.post(url, headers=headers, data=data)
with open('comment.txt', 'w', encoding='utf-8') as f:
f.write(res.text)
comments_json = json.loads(res.text)
print(comments_json)
return
if __name__ == '__main__':
comment()
pass
边栏推荐
- 53. 最大子数组和:给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。
- Assembly language - Beginner's introduction
- 【云资源】云资源安全管理用什么软件好?为什么?
- web3.eth. Filter related
- 搭建一个仪式感点满的网站,并内网穿透发布到公网 2/2
- Laravel框架运行报错:No application encryption key has been specified
- Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"
- Laravel generate entity
- The real king of caching, Google guava is just a brother
- 【 script secret pour l'utilisation de MySQL 】 un jeu en ligne sur l'heure et le type de date de MySQL et les fonctions d'exploitation connexes (3)
猜你喜欢
Jetpack compose introduction to mastery
Zibll theme external chain redirection go page beautification tutorial
:: ffff:192.168.31.101 what address is it?
PHP basic syntax
Laravel框架运行报错:No application encryption key has been specified
几款分布式数据库的对比
我为什么支持 BAT 拆掉「AI 研究院」
Introduction to Chapter 8 proof problem of njupt "Xin'an numeral base"
[South China University of technology] information sharing of postgraduate entrance examination and re examination
How to apply the updated fluent 3.0 to applet development
随机推荐
49. 字母异位词分组:给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。 字母异位词 是由重新排列源单词的字母得到的一个新单词,所有源单词中的字母通常恰好只用一次。
Jetpack Compose入门到精通
Integer ==比较会自动拆箱 该变量不能赋值为空
"Baidu Cup" CTF competition in September, web:upload
Flutter 3.0更新后如何应用到小程序开发中
PHP basic syntax
Nantong online communication group
[cloud resources] what software is good for cloud resource security management? Why?
2022年机修钳工(高级)考试题模拟考试题库模拟考试平台操作
Zhubo Huangyu: it's really bad not to understand these gold frying skills
【MySQL 使用秘籍】一网打尽 MySQL 时间和日期类型与相关操作函数(三)
The real king of caching, Google guava is just a brother
With 4 years of working experience, you can't tell five ways of communication between multithreads. Dare you believe it?
[MySQL usage Script] catch all MySQL time and date types and related operation functions (3)
TortoiseSVN使用情形、安装与使用
Zhubo Huangyu: these spot gold investment skills are not really bad
redis6事务和锁机制
Personal component - message prompt
redis6主从复制及集群
How to divide a large 'tar' archive file into multiple files of a specific size