mirror of https://github.com/scrapy/scrapy.git
update spider templates
This commit is contained in:
parent
1117687c47
commit
72f68dcc8e
|
|
@ -1,5 +1,6 @@
|
|||
import scrapy
|
||||
|
||||
|
||||
class $classname(scrapy.Spider):
|
||||
name = "$name"
|
||||
allowed_domains = ["$domain"]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
|
|||
from scrapy.contrib.spiders import CrawlSpider, Rule
|
||||
from $project_name.items import ${ProjectName}Item
|
||||
|
||||
|
||||
class $classname(CrawlSpider):
|
||||
name = '$name'
|
||||
allowed_domains = ['$domain']
|
||||
|
|
@ -13,9 +14,8 @@ class $classname(CrawlSpider):
|
|||
)
|
||||
|
||||
def parse_item(self, response):
|
||||
sel = scrapy.Selector(response)
|
||||
i = ${ProjectName}Item()
|
||||
#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()
|
||||
#i['domain_id'] = response.xpath('//input[@id="sid"]/@value').extract()
|
||||
#i['name'] = response.xpath('//div[@id="name"]').extract()
|
||||
#i['description'] = response.xpath('//div[@id="description"]').extract()
|
||||
return i
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from scrapy.contrib.spiders import CSVFeedSpider
|
||||
from $project_name.items import ${ProjectName}Item
|
||||
|
||||
|
||||
class $classname(CSVFeedSpider):
|
||||
name = '$name'
|
||||
allowed_domains = ['$domain']
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from scrapy.contrib.spiders import XMLFeedSpider
|
||||
from $project_name.items import ${ProjectName}Item
|
||||
|
||||
|
||||
class $classname(XMLFeedSpider):
|
||||
name = '$name'
|
||||
allowed_domains = ['$domain']
|
||||
|
|
|
|||
Loading…
Reference in New Issue