You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
694 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

运行此代码前需要安装以下库
requests用于发送 HTTP 请求,获取网页和 API 数据
pandas用于数据处理和 Excel 文件生成
jieba中文分词工具用于词云生成
wordcloud生成词云图
matplotlib绘图库用于显示和保存词云图
beautifulsoup4解析 HTML/XML 数据(此处用于解析弹幕 XML
lxmlBeautifulSoup 的解析器,需配合使用
openpyxl用于 pandas 写入 Excel 文件
numpy数值计算库词云生成可能依赖
Pillow图像处理库用于词云背景等图像处理
运行以下代码即可:
pip install requests pandas jieba wordcloud matplotlib beautifulsoup4 openpyxl numpy Pillow lxml