Skip to content

Commit

Permalink
Atualiza raspador de Jundiaí-SP (#1352)
Browse files Browse the repository at this point in the history
resolve #1342
  • Loading branch information
trevineju authored Jan 11, 2025
2 parents a94920a + 45e6fc3 commit cf5aa7a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data_collection/gazette/spiders/sp/sp_jundiai.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime as dt

import dateparser
import scrapy
from dateutil.rrule import MONTHLY, rrule

Expand Down Expand Up @@ -29,8 +30,8 @@ def start_requests(self):
def parse(self, response, current_page=1):
editions = response.css("#lista-edicoes li.edicao-atual")
for edition in editions:
raw_date = edition.xpath("./a/span[2]/text()").get()
date = dt.datetime.strptime(raw_date, "%d/%m/%Y").date()
raw_date = edition.css(".data-lista div::text")[1].get()
date = dateparser.parse(raw_date, languages=["pt"]).date()

if date > self.end_date:
continue
Expand Down

0 comments on commit cf5aa7a

Please sign in to comment.