text: # -*- coding: utf-8 -*-
  from scrapy.crawler import CrawlerProcess
  from scrapy.utils.project import get_project_settings
  
  # 这里是必须引入的
  import scrapy.spiderloader
  import scrapy.statscollectors
  import scrapy.logformatter
  import scrapy.dupefilters
  import scrapy.squeues
  
  import scrapy.extensions.spiderstate
  import scrapy.extensions.corestats
  import scrapy.extensions.telnet
  import scrapy.extensions.logstats
  import scrapy.extensions.memusage
  import scrapy.extensions.memdebug
  import scrapy.extensions.feedexport
  import scrapy.extensions.closespider
  import scrapy.extensions.debug
  import scrapy.extensions.httpcache
  import scrapy.extensions.statsmailer
  import scrapy.extensions.throttle
  
  import scrapy.core.scheduler
  import scrapy.core.engine
  import scrapy.core.scraper
  import scrapy.core.spidermw
  import scrapy.core.downloader
  
  import scrapy.downloadermiddlewares.stats
  import scrapy.downloadermiddlewares.httpcache
  import scrapy.downloadermiddlewares.cookies
  import scrapy.downloadermiddlewares.useragent
  import scrapy.downloadermiddlewares.httpproxy
  import scrapy.downloadermiddlewares.ajaxcrawl
  #import scrapy.downloadermiddlewares.chunked
  import scrapy.downloadermiddlewares.decompression
  import scrapy.downloadermiddlewares.defaultheaders
  import scrapy.downloadermiddlewares.downloadtimeout
  import scrapy.downloadermiddlewares.httpauth
  import scrapy.downloadermiddlewares.httpcompression
  import scrapy.downloadermiddlewares.redirect
  import scrapy.downloadermiddlewares.retry
  import scrapy.downloadermiddlewares.robotstxt
  
  import scrapy.spidermiddlewares.depth
  import scrapy.spidermiddlewares.httperror
  import scrapy.spidermiddlewares.offsite
  import scrapy.spidermiddlewares.referer
  import scrapy.spidermiddlewares.urllength
  
  import scrapy.pipelines
  
  import scrapy.core.downloader.handlers.http
  import scrapy.core.downloader.contextfactory
  
  # 自己项目用到的
  # import scrapy.pipelines.images  # 用到图片管道
  import os
  import sys
  from scrapy.pipelines.images import ImagesPipeline
  # 切换工作目录,防止python库加载失败
  base_path = sys.path[1]
  print('Working directory: ' + base_path)
  os.chdir(base_path)
  
  from PIL import Image
  import platform
  if platform.system() == 'Windows':
      import win32con
  
  process = CrawlerProcess(get_project_settings())
  
  # 'sk' is the name of one of the spiders of the project.
  process.crawl('binbot')
  process.start()