mirror of https://github.com/scrapy/scrapy.git
Merge pull request #484 from nyov/nyov/crawl-tmpl-selector
Update CrawlSpider Template with Selector changes
This commit is contained in:
commit
11359188a5
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue