Skip to content

Commit 3bd05b6

Browse files
committed
Update readme
1 parent 6e43fb9 commit 3bd05b6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#Python 爬虫:把廖雪峰的教程转换成 PDF 电子书
22

3+
### 系统要求
4+
python3.4以上版本, 不支持python2.x
5+
6+
37
### 准备工具
48

59
requests、beautifulsoup 是爬虫两大神器,reuqests 用于网络请求,beautifusoup 用于操作 html 数据。有了这两把梭子,干起活来利索。scrapy 这样的爬虫框架我们就不用了,这样的小程序派上它有点杀鸡用牛刀的意思。此外,既然是把 html 文件转为 pdf,那么也要有相应的库支持, wkhtmltopdf 就是一个非常的工具,它可以用适用于多平台的 html 到 pdf 的转换,pdfkit 是 wkhtmltopdf 的Python封装包。首先安装好下面的依赖包

crawler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def func(m):
5252
return rtn
5353
else:
5454
return m.group(1)+m.group(2)+m.group(3)
55-
5655
html = re.compile(pattern).sub(func, html)
5756
html = html_template.format(content=html)
5857
html = html.encode("utf-8")

0 commit comments

Comments
 (0)