windows安装pyspider教程
1、安装python或者anaconda(在添加环境变量,包括安装路径、Scripts路径等,)
2、在dos下运行pip install pyspider 安装pyspider环境
3、在dos中运行pip install -U distribute
4、在dos中运行pyspider all 启动pyspider
5、在浏览器中访问http://localhost:5000/,访问成功则表示pyspider安装成功。
pyspider运行测试:
1、创建项目:
2、对url进行爬取内容,如果url为https,则需要证书才能爬取:
解决方法:
使用self.crawl(url, callback=self.index_page, validate_cert=False)
并参考https://cuiqingcai.com/2703.html或者参考http://blog.csdn.net/asmcvc/article/details/51016485文末。