Scrape NetEase Cloud Music Hot Comments and Visualize Them with Word Clouds

This tutorial demonstrates how to capture hot comments from NetEase Cloud Music using web‑scraping techniques, handle the platform's encrypted API, and generate a Chinese word cloud with Python's WordCloud library for visual insight.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Scrape NetEase Cloud Music Hot Comments and Visualize Them with Word Clouds

Introduction

Web crawlers enable many fun applications, such as extracting comments, while word clouds visualize word frequency in an appealing graphic. This article combines both techniques to scrape NetEase Cloud Music hot comments and create a word cloud.

Data Capture

To build a word cloud, we first need comment data, which requires basic crawling skills:

Packet capture analysis

Encrypted information handling

Fetching hot comment content

Packet Capture

Using Chrome DevTools, locate the comment API URL (see image). The request is a POST with specific fields.

Encrypted Information Handling

By copying the request payload from the browser, we can bypass encryption for this tutorial. For a deeper understanding, refer to community analyses of NetEase Cloud Music's encryption.

NetEase Cloud Music New Login API Analysis

Fetching Hot Comments

The API returns a JSON string containing the comments, which can be parsed directly.

Running the script yields the comment data (see result image).

Word Cloud Generation

The WordCloud library (installable via pip) is used to create the visualization. The library’s documentation provides detailed examples.

Chinese characters require specifying a font file to avoid garbled output. The configuration is:

WordCloud(random_state=1, font_path=r'C:/Users/Windows/fonts/simkai.ttf')

Result

The final word cloud visualizes the most frequent terms in the hot comments.

Conclusion

This article demonstrated how to scrape NetEase Cloud Music hot comments and generate a corresponding word cloud. Possible extensions include using mask images for shaped word clouds, batch scraping multiple songs by ID, and packaging the functionality as a comment‑or‑word‑cloud service.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonData visualizationWeb ScrapingNetEase Cloud Musicword cloud
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.