Corrected syntax errors in templates

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40500
This commit is contained in:
elpolilla 2008-12-15 15:06:52 +00:00
parent e5a476f95e
commit 95c00c99b0
3 changed files with 19 additions and 19 deletions

View File

@ -7,18 +7,18 @@ from scrapy.link.extractors import RegexLinkExtractor
from scrapy.contrib.spiders import CrawlSpider, Rule
class $classname(CrawlSpider):
domain_name = "$site"
domain_name = '$site'
start_urls = ['http://www.$site/']
rules = (
Rule(RegexLinkExtractor(allow=(r'Items/', ), 'parse_item', follow=True)
Rule(RegexLinkExtractor(allow=(r'Items/', )), 'parse_item', follow=True),
)
def parse_item(self, response):
#xs = HtmlXPathSelector(response)
#i = ScrapedItem()
#i.attribute('site_id', xs.x("//input[@id="sid"]/@value"))
#i.attribute('name', xs.x("//div[@id='name']"))
#i.attribute('description', xs.x("//div[@id='description']"))
#i.attribute('site_id', xs.x('//input[@id="sid"]/@value'))
#i.attribute('name', xs.x('//div[@id="name"]'))
#i.attribute('description', xs.x('//div[@id="description"]'))
SPIDER = $classname()

View File

@ -2,7 +2,7 @@
from scrapy.contrib.spiders import CSVFeedSpider
class $classname(CSVFeedSpider):
domain_name = "$site"
domain_name = '$site'
start_urls = ['http://www.$site/feed.csv']
# headers = ['id', 'name', 'description', 'image_link']
# delimiter = '\t'
@ -13,11 +13,11 @@ class $classname(CSVFeedSpider):
def parse_row(self, response, row):
p = self.create_product(response)
#p.attribute("site_id", row["id"])
#p.attribute("supplier", self.domain_name)
#p.attribute("name", row["name"])
#p.attribute("description", row["description"])
#p.attribute("image_urls", row["image_link"])
#p.attribute('site_id', row['id'])
#p.attribute('supplier', self.domain_name)
#p.attribute('name', row['name'])
#p.attribute('description', row['description'])
#p.attribute('image_urls', row['image_link'])
return p
SPIDER = $classname()

View File

@ -2,19 +2,19 @@
from scrapy.contrib.spiders import XMLFeedSpider
class $classname(XMLFeedSpider):
domain_name = "$site"
domain_name = '$site'
start_urls = ['http://www.$site/feed.xml']
def parse_item(self, response, xSel):
p = self.create_product(response)
#p.attribute('url', xSel(""))
#p.attribute('url', xSel(''))
#p.attribute('supplier', self.domain_name)
#p.attribute('site_id', xSel(""))
#p.attribute('name', xSel(""))
#p.attribute('description', xSel(""))
#p.attribute('image_urls', xSel(""))
#p.attribute('price', xSel(""))
#p.attribute('dimensions', xSel(""))
#p.attribute('site_id', xSel(''))
#p.attribute('name', xSel(''))
#p.attribute('description', xSel(''))
#p.attribute('image_urls', xSel(''))
#p.attribute('price', xSel(''))
#p.attribute('dimensions', xSel(''))
return p
SPIDER = $classname()