Advertisement
Guest User

Untitled

a guest
Feb 1st, 2021
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import os
  2. import sys
  3. sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), ".."))
  4. os.environ['DJANGO_SETTINGS_MODULE'] = 'xmas.settings'
  5. import django
  6. django.setup()
  7. USER_AGENT = 'MOZILLA/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html'
  8. DOWNLOAD_DELAY = 2
  9.  
  10.  
  11. BOT_NAME = 'xs2'
  12.  
  13. SPIDER_MODULES = ['xs2.spiders']
  14. NEWSPIDER_MODULE = 'xs2.spiders'
  15.  
  16.  
  17. # Crawl responsibly by identifying yourself (and your website) on the user-agent
  18. #USER_AGENT = 'xs2 (+http://www.yourdomain.com)'
  19.  
  20. # Obey robots.txt rules
  21. ROBOTSTXT_OBEY = True
  22.  
  23. # Configure maximum concurrent requests performed by Scrapy (default: 16)
  24. #CONCURRENT_REQUESTS = 32
  25.  
  26. # Configure a delay for requests for the same website (default: 0)
  27. # See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
  28. # See also autothrottle settings and docs
  29. #DOWNLOAD_DELAY = 3
  30. # The download delay setting will honor only one of:
  31. #CONCURRENT_REQUESTS_PER_DOMAIN = 16
  32. #CONCURRENT_REQUESTS_PER_IP = 16
  33.  
  34. # Disable cookies (enabled by default)
  35. #COOKIES_ENABLED = False
  36.  
  37. # Disable Telnet Console (enabled by default)
  38. #TELNETCONSOLE_ENABLED = False
  39.  
  40. # Override the default request headers:
  41. #DEFAULT_REQUEST_HEADERS = {
  42. # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  43. # 'Accept-Language': 'en',
  44. #}
  45.  
  46. # Enable or disable spider middlewares
  47. # See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
  48. #SPIDER_MIDDLEWARES = {
  49. # 'xs2.middlewares.Xs2SpiderMiddleware': 543,
  50. #}
  51.  
  52.  
  53. # Enable or disable downloader middlewares
  54. # See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
  55. #DOWNLOADER_MIDDLEWARES = {
  56. # 'xs2.middlewares.Xs2DownloaderMiddleware': 543,
  57. #}
  58.  
  59. # Enable or disable extensions
  60. # See https://docs.scrapy.org/en/latest/topics/extensions.html
  61. #EXTENSIONS = {
  62. # 'scrapy.extensions.telnet.TelnetConsole': None,
  63. #}
  64.  
  65. # Configure item pipelines
  66. # See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
  67. ITEM_PIPELINES = {
  68. 'xs2.pipelines.Xs2Pipeline': 300,
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement