功能概述
通过Python网络爬虫,爬取相关专栏文章,保存内容至本地文件夹,格式为html,PDF,makedown。
效果展示
环境准备:
-
python基础环境
-
安装相关库:
- pip install requests
- pip install parsel
- pip install pdfkit
- pip install html2text
-
安装wkhtmltopdf(下载方式见百度)
运行步骤
clone到本地
导入vscode
按照注释修改代码中指定位置
右键run code运行代码
项目源码
"""
Author:Lorren
Time : 2022年8月28日10:41:49
Function:Crawl the blog post of blogger csdn and save it in html/pdf/markdown formats
"""
import requests