【项目实战】爬取csdn指定专栏的文章

功能概述

通过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

猜你喜欢

转载自blog.csdn.net/weixin_43717839/article/details/129810796
今日推荐