removed redudant part of Scrapy introduction to make it simpler. thanks Ismael for pointing that out

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40851
This commit is contained in:
Pablo Hoffman 2009-02-12 20:58:42 +00:00
parent 8557f6bc57
commit 47cf45c916
1 changed files with 2 additions and 13 deletions

View File

@ -37,17 +37,6 @@ The list of all torrents added today can be found in this page:
http://www.mininova.org/today
Define the Item
===============
First of all we need to define a class for the items we're going to extract, so
let's define a Torrent class, which must inherit from ScrapedItem::
from scrapy.item import ScrapedItem
class Torrent(ScrapedItem):
pass
Write a Spider to extract the Items
===================================
@ -140,8 +129,8 @@ Finally, here's the spider code::
def parse_torrent(self, response):
x = HtmlXPathSelector(response)
torrent = Torrent()
torrent = ScrapedItem()
torrent.url = response.url
torrent.name = x.x("//h1/text()").extract()
torrent.description = x.x("//div[@id='description']").extract()