def get_year(self, meta, response):
     regx = '//span[@class="year"]/text()'
     data = response.xpath(regx).extract()
     if data:
         meta['year'] = validator.match_year(data[0])
     return meta
Beispiel #2
0
 def set_year(self, meta, response):
     regex = '//span[@class="year"]/text()'
     match = response.xpath(regex).get()
     if match:
         meta["year"] = validator.match_year(match)
     return meta