-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove save-http-error-middleware; add custom_settings for cpd
- Loading branch information
1 parent
f874c9f
commit 36668bf
Showing
7 changed files
with
24 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import os | ||
|
||
if not os.path.exists('error'): | ||
os.makedirs('error') | ||
if not os.path.exists('log'): | ||
os.makedirs('log') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
from datetime import datetime | ||
|
||
# Scrapy settings for crawler project | ||
# | ||
|
@@ -54,7 +53,6 @@ | |
# Enable or disable spider middlewares | ||
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html | ||
SPIDER_MIDDLEWARES = { | ||
'crawler.middlewares.SaveHttpErrorMiddleware': 49, | ||
'crawler.middlewares.CrawlerSpiderMiddleware': 543, | ||
} | ||
|
||
|
@@ -99,7 +97,6 @@ | |
|
||
DEPTH_LIMIT = 10 | ||
|
||
# LOG_FILE = f"log/crawler_{datetime.now().strftime('%Y.%m.%d_%H:%M:%S')}.log" | ||
LOG_LEVEL = 'DEBUG' | ||
LOG_STDOUT = True | ||
|
||
|
@@ -131,36 +128,4 @@ | |
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; The World)', | ||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; SE 2.X MetaSr 1.0; SE 2.X MetaSr 1.0; .NET CLR 2.0.50727; SE 2.X MetaSr 1.0)', | ||
'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', | ||
# 'zspider/0.9-dev http://feedback.redkolibri.com/', | ||
# 'Xaldon_WebSpider/2.0.b1', | ||
# 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) Speedy Spider (http://www.entireweb.com/about/search_tech/speedy_spider/)', | ||
# 'Mozilla/5.0 (compatible; Speedy Spider; http://www.entireweb.com/about/search_tech/speedy_spider/)', | ||
# 'Speedy Spider (Entireweb; Beta/1.3; http://www.entireweb.com/about/search_tech/speedyspider/)', | ||
# 'Speedy Spider (Entireweb; Beta/1.2; http://www.entireweb.com/about/search_tech/speedyspider/)', | ||
# 'Speedy Spider (Entireweb; Beta/1.1; http://www.entireweb.com/about/search_tech/speedyspider/)', | ||
# 'Speedy Spider (Entireweb; Beta/1.0; http://www.entireweb.com/about/search_tech/speedyspider/)', | ||
# 'Speedy Spider (Beta/1.0; www.entireweb.com)', | ||
# 'Speedy Spider (http://www.entireweb.com/about/search_tech/speedy_spider/)', | ||
# 'Speedy Spider (http://www.entireweb.com/about/search_tech/speedyspider/)', | ||
# 'Speedy Spider (http://www.entireweb.com)', | ||
# 'Sosospider+(+http://help.soso.com/webspider.htm)', | ||
# 'sogou spider', | ||
# 'Nusearch Spider (www.nusearch.com)', | ||
# 'nuSearch Spider (compatible; MSIE 4.01; Windows NT)', | ||
# 'lmspider ([email protected])', | ||
# 'lmspider [email protected]', | ||
# 'ldspider (http://code.google.com/p/ldspider/wiki/Robots)', | ||
# 'iaskspider/2.0(+http://iask.com/help/help_index.html)', | ||
# 'iaskspider', | ||
# 'hl_ftien_spider_v1.1', | ||
# 'hl_ftien_spider', | ||
# 'FyberSpider (+http://www.fybersearch.com/fyberspider.php)', | ||
# 'FyberSpider', | ||
# 'everyfeed-spider/2.0 (http://www.everyfeed.com)', | ||
# 'envolk[ITS]spider/1.6 (+http://www.envolk.com/envolkspider.html)', | ||
# 'envolk[ITS]spider/1.6 ( http://www.envolk.com/envolkspider.html)', | ||
# 'Baiduspider+(+http://www.baidu.com/search/spider_jp.html)', | ||
# 'Baiduspider+(+http://www.baidu.com/search/spider.htm)', | ||
# 'BaiDuSpider', | ||
# 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) AddSugarSpiderBot www.idealobserver.com', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3' | ||
|
||
services: | ||
|
||
crawler: | ||
image: registry.cn-hangzhou.aliyuncs.com/traffic_news/cpd_crawler:latest | ||
container_name: crawler | ||
command: scrapy crawl cpd | ||
volumes: | ||
- ./log/:/project/log/ | ||
networks: | ||
- crawler_net | ||
|
||
networks: | ||
crawler_net: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters