Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Corrected syntax errors in templates

elpolilla95c00c99b062
diff --git a/scrapy/trunk/scrapy/conf/project_template/templates/spider_crawl.tmpl b/scrapy/trunk/scrapy/conf/project_template/templates/spider_crawl.tmpl
index 57ade8435..f4a3bd2ed 100644
--- a/scrapy/trunk/scrapy/conf/project_template/templates/spider_crawl.tmpl
+++ b/scrapy/trunk/scrapy/conf/project_template/templates/spider_crawl.tmpl
@@ -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()
diff --git a/scrapy/trunk/scrapy/conf/project_template/templates/spider_csvfeed.tmpl b/scrapy/trunk/scrapy/conf/project_template/templates/spider_csvfeed.tmpl
index d2a4dc8be..12b2b7d71 100644
--- a/scrapy/trunk/scrapy/conf/project_template/templates/spider_csvfeed.tmpl
+++ b/scrapy/trunk/scrapy/conf/project_template/templates/spider_csvfeed.tmpl
@@ -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()
diff --git a/scrapy/trunk/scrapy/conf/project_template/templates/spider_xmlfeed.tmpl b/scrapy/trunk/scrapy/conf/project_template/templates/spider_xmlfeed.tmpl
index a470063cf..87b3e10eb 100644
--- a/scrapy/trunk/scrapy/conf/project_template/templates/spider_xmlfeed.tmpl
+++ b/scrapy/trunk/scrapy/conf/project_template/templates/spider_xmlfeed.tmpl
@@ -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()