Skip to content
Permalink
Browse files

Update CrawlSpider Template with Selector changes

  • Loading branch information
nyov authored and dangra committed Dec 9, 2013
1 parent b4fc359 commit 6d1457dec9b12a680370a4a1d5f40f606f3c078c
Showing with 5 additions and 5 deletions.
  1. +5 −5 scrapy/templates/spiders/crawl.tmpl
@@ -1,4 +1,4 @@
from scrapy.selector import HtmlXPathSelector
from scrapy.selector import Selector
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
from $project_name.items import ${ProjectName}Item
@@ -13,9 +13,9 @@ class $classname(CrawlSpider):
)

def parse_item(self, response):
hxs = HtmlXPathSelector(response)
sel = Selector(response)
i = ${ProjectName}Item()
#i['domain_id'] = hxs.select('//input[@id="sid"]/@value').extract()
#i['name'] = hxs.select('//div[@id="name"]').extract()
#i['description'] = hxs.select('//div[@id="description"]').extract()
#i['domain_id'] = sel.xpath('//input[@id="sid"]/@value').extract()
#i['name'] = sel.xpath('//div[@id="name"]').extract()
#i['description'] = sel.xpath('//div[@id="description"]').extract()
return i

0 comments on commit 6d1457d

Please sign in to comment.