Commit 24e802de authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

comments fix

parent 4bedded4
...@@ -23,8 +23,8 @@ class NoticiasItem(scrapy.Item): ...@@ -23,8 +23,8 @@ class NoticiasItem(scrapy.Item):
class NoticiasSpider(scrapy.Spider): class NoticiasSpider(scrapy.Spider):
name = "noticias" name = "noticias"
def start_requests(self): def start_requests(self):
"""Lista de url a explorar.""" """Lista de url a explorar."""
year = getattr(self, 'year', None) year = getattr(self, 'year', None)
month = getattr(self, 'month', None) month = getattr(self, 'month', None)
...@@ -47,7 +47,7 @@ class NoticiasSpider(scrapy.Spider): ...@@ -47,7 +47,7 @@ class NoticiasSpider(scrapy.Spider):
yield scrapy.Request(url=url, callback=self.parse) yield scrapy.Request(url=url, callback=self.parse)
def parse(self, response): def parse(self, response):
"""parser principal.""" """parser principal."""
item = NoticiasItem() item = NoticiasItem()
for noticia in response.css('a.cabeza'): for noticia in response.css('a.cabeza'):
...@@ -55,7 +55,7 @@ class NoticiasSpider(scrapy.Spider): ...@@ -55,7 +55,7 @@ class NoticiasSpider(scrapy.Spider):
yield scrapy.Request(url, callback=self.parse_dir_contents) yield scrapy.Request(url, callback=self.parse_dir_contents)
def parse_dir_contents(self, response): def parse_dir_contents(self, response):
"""Parser para la pagina de cada noticia.""" """Parser para la pagina de cada noticia."""
item = NoticiasItem() item = NoticiasItem()
item['title'] = response.css('div.cabeza::text').extract_first() item['title'] = response.css('div.cabeza::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