首页 > 其他 > 详细

Scrapy

时间:2015-04-10 17:33:19      阅读:153      评论:0      收藏:0      [点我收藏+]

$ Ubuntu 14.04 LTS

安装Scrapy

pip install scrapy

http://scrapy.org/

安装pip

sudo apt-get install python-pip

http://blog.csdn.net/kingppy/article/details/13080919

测试Scrapy

 1 pip install scrapy
 2 cat > myspider.py <<EOF
 3 
 4 from scrapy import Spider, Item, Field
 5 
 6 class Post(Item):
 7     title = Field()
 8 
 9 class BlogSpider(Spider):
10     name, start_urls = blogspider, [http://blog.scrapinghub.com]
11 
12     def parse(self, response):
13         return [Post(title=e.extract()) for e in response.css("h2 a::text")]
14 
15 EOF
16 scrapy runspider myspider.py

[ERROR]You do not have a working installation of the service_identity module...

http://www.cnblogs.com/QuDump/p/3750447.html

pip install service_identity

 

Scrapy

原文:http://www.cnblogs.com/daijkstra/p/4415051.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!