
Scrapy
安装Scrapy
可能的报错
安装失败,使用全局代理,点击链接,下载对应版本的Twisted(cp后面是python版本,amd64代表python64位),下载后运行pip先安装驱动。再pip install scrapy
No module named ‘win32con’,pip install pypiwin32
测试
性能测试,输入scrapy bench,通过计算机性能测得
爬虫测试,输入scrapy fetch "http://baidu.com
shell环境测试,输入scrapy shell "http://baidu.com"
项目开始
创建项目scrapy startproject xxx
创建爬虫scrapy genspider itcast "itcast.cn "
检查爬虫模块scrapy check itcast
运行爬虫scrapy crawl itcast
Comments