介绍
简单分析下极客时间课程的爬虫功能
公共post方法
1  | session = requests.session()  | 
登录
1  | def login(phone, pwd):  | 
获取指定课程的所有章节
1  | def get_all_articles(product):  | 
获取指定章节的内容
1  | def get_content(articleid):  | 
获取指定课程的所有内容
1  | def get_articles(product):  | 
保存为pdf
输出为html内容,通过 pdfkit 插件转化为pdf文件