code: def stop(self, spider_name=None):
          
          if spider_name is None:
              spider_name = self.spider_name
          else:
              self.spider_name = spider_name
          if self.spider_name is None:
              self.spider_name = self.list_running()[0].split(':')[-1]
          self.jsonrpc_call('crawler/engine', 'close_spider', self.spider_name)
docs: Stop the named running spider, or the first spider found, if spider_name is None