Files
nypc_python_advanced/Spider/neteaseMusicSpider
iamzhaohaibo d5a68effec update Spider/neteaseMusicSpider/readme.md.
Signed-off-by: iamzhaohaibo <941604465@qq.com>
2025-12-13 08:57:02 +00:00
..
2025-12-13 07:07:35 +00:00
2025-12-13 08:22:15 +00:00

代码使用&驱动下载说明

建议使用Google Chrome 浏览器

一、创建虚拟环境并下载对应packages推荐

🎗️作者建议:真的建议所有的Python学习者去使用虚拟环境。创建方法参考如下:

1、使用Pycharm创建项目时候去创建虚拟环境

image-20251213151523446

Based on your own existing python interpreter to create a virtual python interpreter environment by Virtualenv Tool.

2、使用命令创建虚拟环境

确保你的Python环境已经有了venv模块然后在你的Python项目目录下执行如下指令

python -m venv YourVirtualEnv # YourVirtualEnv你的虚拟环境名称

3、安装所有的库

pip install -r requirements.txt

请根据Python版本安装合适的依赖版本。

二、检查自己浏览器版本

1、打开Google Chrome

2、F12进入帮助或者浏览器地址栏输入chrome://settings/help

3、复制你的Chrome版本号

image-20251213152220366

4、进入下载地址

1最新版

https://googlechromelabs.github.io/chrome-for-testing/#stable

2直下版

https://storage.googleapis.com/chrome-for-testing-public/版本号/系统类型/文件名.zip

版本号:和自己浏览器对应

系统类型:

Windowswin32/6432bit or 64bit

Macmac-x64/mac-arm64intel Chip/Apple Chip

Linuxlinux64

文件名:

WIndowschromedriver-win32.zip/chromedriver-win64.zip

Macchromedriver-mac-x64.zip/chromedriver-mac-arm64.zip

Linuxchromedriver-linux64.zip

如大部分最新版Windows安装的最新64位Google Chrome可以参考如下链接截止2025-12-13

https://storage.googleapis.com/chrome-for-testing-public/145.0.7575.2/win64/chromedriver-win64.zip

一定要看清楚版本号、系统类型、文件名,少一个都不行。

三、下载解压和修改代码驱动位置

作者的Google Chrome是128.0.6613.138 系统是Mac 10Intel Chipx86_64

那么下载

https://storage.googleapis.com/chrome-for-testing-public/128.0.6613.138/mac-x64/chromedriver-mac-x64.zip

解压:

image-20251213154237730

如果是Windows电脑你们下载的Windows版驱动解压出来的是.exe可执行文件

复制可执行文件到你的项目或者你能找到的地方。

找到驱动注册代码、修改路径:

service = Service(executable_path='./chromedriver_win32/chromedriver.exe')  # 根据自己实际位置来修改,记得!!!!

如我的绝对路径(你的一定一定一定不是这个路径,憋整错了)

/Users/zhaohaibo/Desktop/chromedriver-mac-x64/chromedriver

5、后续改进...

After you have completed all the above processes, just RUN IT !!!!!!!

You and the code must have at least one can RUN.

这里的解析网页函数获取排行的应该是奇数rankId不是所有的因此还要改进。