#!/usr/bin/env python
# -*- coding: utf-8 -*-
# $Id$
#
# Copyright (c) {{ year }} Nuwa Information Co., Ltd, All Rights Reserved.
#
# Licensed under the Proprietary License, 
# you may not use this file except in compliance with the License. 
# You may obtain a copy of the License at our web site.
#
# See the License for the specific language governing permissions and 
# limitations under the License.
#
# $Author$
# $Date$
# $Revision$ 

import scrapy

from Iuno.cloud.logging import attach
from Iuno.scrapy import BaseSpider, saveHtml, Request

"""
# you should setting sentry
attach(
    dsn=("https://xxx:xxx@xxx"),
    attachLoggerName=__name__)
"""

class {{ name }}Spider(BaseSpider):
    name = '{{ name }}'
    allowed_domains = ['{{ domain }}',]
    start_urls = ['http://{{ domain }}/',]
    loggerName = __name__
    
    def start_requests(self):
        for url in self.start_urls:
            yield Request(self, url=url, callback=self.parse)

    @saveHtml
    def parse(self, response):
        self.logger.info(response.url)
        pass