如何在eclipse+pydev运行scrapy项目
- 参考链接:https://www.zhihu.com/question/28565716(eclipse+pydev配置)
- 参考链接:http://www.cnblogs.com/kongzhagen/p/6549053.html(scrapy爬虫简单实例)
1. 通过eclipse+pydev新建一个python工程
设置如图下图:
2. 可以通过scrapy命令行创建一个工程到刚建的eclipse项目下:/Users/it-0003005/Documents/workspace/testScrapy1或者直接拷贝一个scrapy项目到此目录下。
a. 新建了一个scrapy项目
IT-0003005mac:~ it-0003005$ cd /Users/it-0003005/Documents/workspace/testScrapy1
IT-0003005mac:testScrapy1 it-0003005$ scrapy startproject pic
2017-08-19 04:47:13 [scrapy] INFO: Scrapy 1.0.3 started (bot: scrapybot)
2017-08-19 04:47:13 [scrapy] INFO: Optional features available: ssl, http11
2017-08-19 04:47:13 [scrapy] INFO: Overridden settings: {}
New Scrapy project 'pic' created in:
/Users/it-0003005/Documents/workspace/testScrapy1/pic
You can start your first spider with:
cd pic
scrapy genspider example example.com
IT-0003005mac:testScrapy1 it-0003005$ cd pic
IT-0003005mac:pic it-0003005$ scrapy genspider xh xiaohuar.com
Created spider 'xh' using template 'basic' in module:
pic.spiders.xh
b. 在eclipse刷新项目
3. 配置eclipse的编译选项
Run -> Run Configurations,把Python Run下面的旧配置文件删了,新建一个。
配置:
1.
2.
至此配置完成。