Commit 8db4b1ee authored by Vasyl Bodnaruk's avatar Vasyl Bodnaruk

Add date to DB

parent b6524c3b
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import random import dateparser
import scrapy import scrapy
from .base import BaseSpider from .base import BaseSpider
...@@ -27,7 +27,7 @@ class CbSpider(BaseSpider): ...@@ -27,7 +27,7 @@ class CbSpider(BaseSpider):
is_duplicate = False is_duplicate = False
for i in rows: for i in rows:
item = ExaItem() item = ExaItem()
item['date'] = i.xpath("./td[contains(@class, 'date')]/text()").extract_first() item['date'] = dateparser.parse(i.xpath("./td[contains(@class, 'date')]/text()").extract_first()).date()
item['title'] = i.xpath("./td/a/text()").extract_first() item['title'] = i.xpath("./td/a/text()").extract_first()
item['url'] = i.xpath("./td/a/@href").extract_first() item['url'] = i.xpath("./td/a/@href").extract_first()
item.update(self.get_common_items(company)) item.update(self.get_common_items(company))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment