settings.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # -*- coding: utf-8 -*-
  2. # Scrapy settings for youni_spiders project
  3. #
  4. # For simplicity, this file contains only settings considered important or
  5. # commonly used. You can find more settings consulting the documentation:
  6. #
  7. # https://docs.scrapy.org/en/latest/topics/settings.html
  8. # https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
  9. # https://docs.scrapy.org/en/latest/topics/spider-middleware.html
  10. BOT_NAME = 'youni_spiders'
  11. SPIDER_MODULES = ['youni_spiders.spiders']
  12. NEWSPIDER_MODULE = 'youni_spiders.spiders'
  13. MYSQL_HOST = "47.92.174.125"
  14. MYSQL_DBNAME = "platform-community"
  15. MYSQL_USER = "caihongxingqiu"
  16. MYSQL_PASSWORD = "Dzj6rBKIWg1WIGfc"
  17. # Crawl responsibly by identifying yourself (and your website) on the user-agent
  18. #USER_AGENT = 'youni_spiders (+http://www.yourdomain.com)'
  19. # Obey robots.txt rules
  20. ROBOTSTXT_OBEY = False
  21. # Configure maximum concurrent requests performed by Scrapy (default: 16)
  22. #CONCURRENT_REQUESTS = 32
  23. # Configure a delay for requests for the same website (default: 0)
  24. # See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
  25. # See also autothrottle settings and docs
  26. DOWNLOAD_DELAY = 3
  27. # The download delay setting will honor only one of:
  28. #CONCURRENT_REQUESTS_PER_DOMAIN = 16
  29. #CONCURRENT_REQUESTS_PER_IP = 16
  30. # Disable cookies (enabled by default)
  31. COOKIES_ENABLED = False
  32. # Disable Telnet Console (enabled by default)
  33. #TELNETCONSOLE_ENABLED = False
  34. # Override the default request headers:
  35. #DEFAULT_REQUEST_HEADERS = {
  36. # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  37. # 'Accept-Language': 'en',
  38. #}
  39. # Enable or disable spider middlewares
  40. # See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
  41. #SPIDER_MIDDLEWARES = {
  42. # 'youni_spiders.middlewares.YouniSpidersSpiderMiddleware': 543,
  43. #}
  44. # Enable or disable downloader middlewares
  45. # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
  46. #DOWNLOADER_MIDDLEWARES = {
  47. # 'youni_spiders.middlewares.YouniSpidersDownloaderMiddleware': 543,
  48. #}
  49. # Enable or disable extensions
  50. # See https://docs.scrapy.org/en/latest/topics/extensions.html
  51. #EXTENSIONS = {
  52. # 'scrapy.extensions.telnet.TelnetConsole': None,
  53. #}
  54. # Configure item pipelines
  55. # See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
  56. ITEM_PIPELINES = {
  57. 'youni_spiders.pipelines.BuDeJiePipeline': 1,
  58. 'youni_spiders.pipelines.VicePipeline': 1,
  59. }
  60. # Enable and configure the AutoThrottle extension (disabled by default)
  61. # See https://docs.scrapy.org/en/latest/topics/autothrottle.html
  62. AUTOTHROTTLE_ENABLED = True
  63. # The initial download delay
  64. AUTOTHROTTLE_START_DELAY = 5
  65. # The maximum download delay to be set in case of high latencies
  66. AUTOTHROTTLE_MAX_DELAY = 60
  67. # The average number of requests Scrapy should be sending in parallel to
  68. # each remote server
  69. AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
  70. # Enable showing throttling stats for every response received:
  71. #AUTOTHROTTLE_DEBUG = False
  72. # Enable and configure HTTP caching (disabled by default)
  73. # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
  74. #HTTPCACHE_ENABLED = True
  75. #HTTPCACHE_EXPIRATION_SECS = 0
  76. #HTTPCACHE_DIR = 'httpcache'
  77. #HTTPCACHE_IGNORE_HTTP_CODES = []
  78. #HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'