Skip to content

Commit

Permalink
Atualiza raspador para Sumaré-SP (#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevineju authored Jun 15, 2024
2 parents 2760d3d + bd4022d commit 9c40058
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data_collection/gazette/spiders/sp/sp_sumare.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ def parse(self, response):
gazettes = response.css("li.umDO")

for gazette in gazettes:
title = gazette.css("a::attr(title)").get()
title = gazette.css(".file-title::text").get()
url = gazette.css("a::attr(href)").get()
str_date = gazette.css(".areaData::text").get()
str_date = gazette.css(".areaMetade::text").get()
date = datetime.strptime(str_date, "%d/%m/%Y").date()

if not (self.start_date <= date <= self.end_date):
continue

yield Gazette(
edition_number=re.search(r"\d+", title).group(0),
edition_number=re.search(r"\d+", title.strip()).group(0),
date=date,
file_urls=[response.urljoin(url)],
is_extra_edition="extra" in title.lower(),
Expand Down

0 comments on commit 9c40058

Please sign in to comment.