From 74dbf4defed8ae348a327e4674d917b3dd869713 Mon Sep 17 00:00:00 2001 From: neodarz Date: Wed, 6 Feb 2019 00:02:31 +0100 Subject: Add date when page are crawled --- crawler/nevrax/spiders/scrape.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crawler/nevrax/spiders') diff --git a/crawler/nevrax/spiders/scrape.py b/crawler/nevrax/spiders/scrape.py index 785ec3f..d27aecf 100644 --- a/crawler/nevrax/spiders/scrape.py +++ b/crawler/nevrax/spiders/scrape.py @@ -5,6 +5,7 @@ from scrapy.linkextractors import LinkExtractor from scrapy import Selector import config +import datetime class NevraxSpider(CrawlSpider): name = "nevrax" @@ -42,5 +43,6 @@ class NevraxSpider(CrawlSpider): 'url': response.url, 'title': response.css('title::text').extract_first(), 'content': ''.join(sel.select("//body//text()").extract()).strip(), - 'content_length': len(response.body) + 'content_length': len(response.body), + 'date_updated': datetime.datetime.now() } -- cgit v1.2.1