Commit bf10fdfb authored by Mario Chirinos's avatar Mario Chirinos

puntomedio

parent 3b8d2de5
......@@ -18,7 +18,7 @@ class NoticiasSpider(scrapy.Spider):
day = getattr(self, 'day', None)
self.baseURL = "http://www.puntomedio.mx/" + year + "/" + month + "/" + day
self.date = year + "-" + month.zfill(2) + "-" + self.day.zfill(2)
yield scrapy.Request(url=self.baseURL, callback=self.parseDate)
#-----------------------------------------------------------------------
def parseDate(self, response):
......@@ -31,7 +31,7 @@ class NoticiasSpider(scrapy.Spider):
def parse_item(self, response):
item = PuntomedioItem()
text = ''
item["date"] = response.xpath('//meta[@property="article:published_time"]/@content').extract_first()
item["date"] = self.date#response.xpath('//meta[@property="article:published_time"]/@content').extract_first()
item['title'] = response.css('h1.title::text').extract_first()
item['topic'] = response.xpath('//ul[@class="post-categories"]/li/a/text()').extract_first()
......
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