Go to file
zcy f134ac8ad6 ee 2024-07-03 17:49:47 +08:00
.idea 🐛🔨🆕 2021-02-27 23:01:45 +08:00
.vscode ee 2024-07-03 17:49:47 +08:00
assets add cookie login 2019-11-08 11:57:43 +08:00
blog/ds19991999 ee 2024-07-03 17:49:47 +08:00
csdn empty 2024-07-03 17:41:44 +08:00
.gitignore ee 2024-07-03 17:49:47 +08:00
LICENSE Initial commit 2019-10-19 18:54:26 +08:00
README.md 🐛🔨🆕 修复 BUG,去掉低级多线程爬取 2021-02-27 23:06:35 +08:00
requirements.txt Bump requests from 2.22.0 to 2.31.0 2023-05-22 22:30:53 +00:00
single_article.py empty 2024-07-03 17:41:44 +08:00
user.py empty 2024-07-03 17:41:44 +08:00

README.md

CSDN 爬虫

主要功能:爬取 csdn 博客指定用户的所有博文并转换为 markdown 格式保存到本地。

下载脚本

git clone https://github.com/ds19991999/csdn-spider.git
cd csdn-spider
python3 -m pip install -r requirements.txt

# 测试
python3 test.py # 需要先配置登录 cookie

登录 csdn 账号,进入:https://blog.csdn.net ,按 F12 调试网页,复制所有的 Request Headers,保存到cookie.txt文件中

1571482112632

爬取用户全部博文

import csdn
csdn.spider("ds19991999", "cookie.txt")
# 参数 usernames: str, cookie_path:str, folder_name: str = "blog"

LICENSE

Creative Commons License

PS:随意写的爬虫脚本,佛系更新。