码迷,mamicode.com
首页 > 其他好文 > 详细

Scrapy

时间:2015-04-10 17:34:06      阅读:174      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!