class MySpider(BaseSpider):

     # http://www.sharejs.com

    name = 'my_spider'   

 

    def __init__(self, *args, **kwargs):

      super(MySpider, self).__init__(*args, **kwargs)

 

      self.start_urls = [kwargs.get('start_url')]

 

 

#该代码片段来自于: http://www.sharejs.com/codes/python/8809

命令行

scrapy crawl my_spider -a start_url="http://some_url"