From c1b6bed81de2becbcb0ddaaeec4fd5ea5b4134e1 Mon Sep 17 00:00:00 2001 From: Gusev Anton <gusev_aa@groupbwt.com> Date: Mon, 17 Jun 2019 13:27:31 +0300 Subject: [PATCH] change directory for writing stats, images --- src/pipelines/StatsWriter.py | 2 +- src/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pipelines/StatsWriter.py b/src/pipelines/StatsWriter.py index da2042e..2cc540d 100644 --- a/src/pipelines/StatsWriter.py +++ b/src/pipelines/StatsWriter.py @@ -5,6 +5,6 @@ class StatsWriter(object): def close_spider(self, spider): stats = spider.crawler.stats.get_stats() - with open('../statistics.txt', 'w') as f: + with open('/statistics.txt', 'w') as f: for k, v in stats.items(): f.writelines('{}: {}\n'.format(k, v)) diff --git a/src/settings.py b/src/settings.py index 782dd67..10af87f 100644 --- a/src/settings.py +++ b/src/settings.py @@ -68,7 +68,7 @@ ROBOTSTXT_OBEY = True # Configure item pipelines # See https://doc.scrapy.org/en/latest/topics/item-pipeline.html -IMAGES_STORE = '../image' +IMAGES_STORE = './image' ITEM_PIPELINES = { 'pipelines.DatabaseWriter.DatabaseWriter': 101, 'pipelines.StatsMailer.StatsMailer': 999, -- GitLab