Merge pull request #484 from nyov/nyov/crawl-tmpl-selector

Update CrawlSpider Template with Selector changes
This commit is contained in:
Daniel Graña 2013-12-09 12:21:27 -08:00
commit 11359188a5
1 changed files with 5 additions and 5 deletions

View File

@ -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