|
@@ -11,35 +11,33 @@
|
|
|
|
|
|
|
|
BOT_NAME = 'douban'
|
|
BOT_NAME = 'douban'
|
|
|
|
|
|
|
|
|
|
+MONGO_SERVER = '120.77.222.217'
|
|
|
|
|
+MONGO_PORT = 27017
|
|
|
|
|
+
|
|
|
SPIDER_MODULES = ['douban.spiders']
|
|
SPIDER_MODULES = ['douban.spiders']
|
|
|
NEWSPIDER_MODULE = 'douban.spiders'
|
|
NEWSPIDER_MODULE = 'douban.spiders'
|
|
|
|
|
|
|
|
|
|
|
|
|
# Crawl responsibly by identifying yourself (and your website) on the user-agent
|
|
# Crawl responsibly by identifying yourself (and your website) on the user-agent
|
|
|
-USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5'
|
|
|
|
|
|
|
+USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ' \
|
|
|
|
|
+ 'Chrome/65.0.3325.181 Safari/537.36'
|
|
|
|
|
|
|
|
# Obey robots.txt rules
|
|
# Obey robots.txt rules
|
|
|
-ROBOTSTXT_OBEY = True
|
|
|
|
|
|
|
+ROBOTSTXT_OBEY = False
|
|
|
|
|
|
|
|
# Configure maximum concurrent requests performed by Scrapy (default: 16)
|
|
# Configure maximum concurrent requests performed by Scrapy (default: 16)
|
|
|
-#CONCURRENT_REQUESTS = 32
|
|
|
|
|
|
|
+CONCURRENT_REQUESTS = 2
|
|
|
|
|
|
|
|
# Configure a delay for requests for the same website (default: 0)
|
|
# Configure a delay for requests for the same website (default: 0)
|
|
|
# See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
|
|
# See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
|
|
|
# See also autothrottle settings and docs
|
|
# See also autothrottle settings and docs
|
|
|
-DOWNLOAD_DELAY = 3
|
|
|
|
|
-RANDOMIZE_DOWNLOAD_DELAY = True
|
|
|
|
|
|
|
+DOWNLOAD_DELAY = 5
|
|
|
# The download delay setting will honor only one of:
|
|
# The download delay setting will honor only one of:
|
|
|
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
|
|
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
|
|
|
#CONCURRENT_REQUESTS_PER_IP = 16
|
|
#CONCURRENT_REQUESTS_PER_IP = 16
|
|
|
|
|
|
|
|
# Disable cookies (enabled by default)
|
|
# Disable cookies (enabled by default)
|
|
|
-COOKIES_ENABLED = True
|
|
|
|
|
-
|
|
|
|
|
-MONGODB_SERVER = '120.77.222.217'
|
|
|
|
|
-MONGODB_PORT = 27017
|
|
|
|
|
-MONGODB_DB = 'douban'
|
|
|
|
|
-MONGODB_COLLECTION = 'movie'
|
|
|
|
|
|
|
+#COOKIES_ENABLED = False
|
|
|
|
|
|
|
|
# Disable Telnet Console (enabled by default)
|
|
# Disable Telnet Console (enabled by default)
|
|
|
#TELNETCONSOLE_ENABLED = False
|
|
#TELNETCONSOLE_ENABLED = False
|
|
@@ -58,9 +56,9 @@ MONGODB_COLLECTION = 'movie'
|
|
|
|
|
|
|
|
# Enable or disable downloader middlewares
|
|
# Enable or disable downloader middlewares
|
|
|
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
|
|
# See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
|
|
|
-#DOWNLOADER_MIDDLEWARES = {
|
|
|
|
|
-# 'douban.middlewares.DoubanDownloaderMiddleware': 543,
|
|
|
|
|
-#}
|
|
|
|
|
|
|
+DOWNLOADER_MIDDLEWARES = {
|
|
|
|
|
+ 'douban.middlewares.DoubanDownloaderMiddleware': 543,
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
# Enable or disable extensions
|
|
# Enable or disable extensions
|
|
|
# See https://doc.scrapy.org/en/latest/topics/extensions.html
|
|
# See https://doc.scrapy.org/en/latest/topics/extensions.html
|
|
@@ -71,11 +69,9 @@ MONGODB_COLLECTION = 'movie'
|
|
|
# Configure item pipelines
|
|
# Configure item pipelines
|
|
|
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
|
|
# See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
|
|
|
ITEM_PIPELINES = {
|
|
ITEM_PIPELINES = {
|
|
|
- 'douban.pipelines.DoubanPipeline': 400,
|
|
|
|
|
|
|
+ 'douban.pipelines.DoubanPipeline': 300,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-LOG_LEVEL = 'DEBUG'
|
|
|
|
|
-
|
|
|
|
|
# Enable and configure the AutoThrottle extension (disabled by default)
|
|
# Enable and configure the AutoThrottle extension (disabled by default)
|
|
|
# See https://doc.scrapy.org/en/latest/topics/autothrottle.html
|
|
# See https://doc.scrapy.org/en/latest/topics/autothrottle.html
|
|
|
#AUTOTHROTTLE_ENABLED = True
|
|
#AUTOTHROTTLE_ENABLED = True
|