极客学院课程网址:http://www.jikexueyuan.com/course/821_2.html?ss=1
任务:
爬取极客学院官方网站的课程库,并保存
Requests介绍与安装:
HTTP for Humans
Python的第三方库,实现网页链接,更自动,更完善,更友好
只需要4行代码,就可以实现
Linux下安装:sudo pip install requests
撞墙了的时候,用以下方法:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
find requests
download whl file
change whl to zip
two folders: requests and ...info
paste to Python/lib/
安装requests实践中遇到问题:
mac python 安装目录
http://blog.csdn.net/guo_hongjun1611/article/details/39780089
mac pip安装
Mac下如何验证pip包管理工具是否安装正确?
直接输入pip回车,如果安装正确会print出pip的help
Pip 是安装python包的工具,提供了安装包,列出已经安装的包,升级包以及卸载包的功能。
Pip 是对easy_install的取代,提供了和easy_install相同的查找包的功能,
因此可以使用easy_install安装的包也同样可以使用pip进行安装。
安装Pip
Pip的安装可以通过源代码包,easy_install或者脚本。
安装 requests 遇到的问题:
$ sudo pip install requests