diff --git a/data_collection/gazette/spiders/es/es_vitoria.py b/data_collection/gazette/spiders/es/es_vitoria.py index 86567e9a8..7b8c19351 100644 --- a/data_collection/gazette/spiders/es/es_vitoria.py +++ b/data_collection/gazette/spiders/es/es_vitoria.py @@ -51,12 +51,9 @@ def make_month_request(self, response): for monthly_date in self._dates_of_interest(MONTHLY): if dt(year, 1, 1) <= monthly_date <= dt(year, 12, 31): - formdata = { - self.FORM_PARAM_YEAR: str(monthly_date.year), self.FORM_PARAM_MONTH: str(monthly_date.month), "__EVENTTARGET": self.FORM_PARAM_MONTH, - "__EVENTARGUMENT": "", } yield FormRequest.from_response( @@ -85,11 +82,8 @@ def parse_editions_list(self, response, current_page=1): if "pagination" in response.text: if response.css(".pagination li")[-1].css("a::text").get(): next_page = current_page + 1 - year, month = response.meta.get("cookiejar") formdata = { - self.FORM_PARAM_YEAR: str(year), - self.FORM_PARAM_MONTH: str(month), "__EVENTTARGET": self.FORM_PARAM_PAGINATION, "__EVENTARGUMENT": f"Page${next_page}", } @@ -104,6 +98,10 @@ def parse_editions_list(self, response, current_page=1): def _dates_of_interest(self, recurrence): dates = rruleset() - dates.rrule(rrule(recurrence, dtstart=self.start_date, until=self.end_date, bymonthday=[1])) + dates.rrule( + rrule( + recurrence, dtstart=self.start_date, until=self.end_date, bymonthday=[1] + ) + ) dates.rdate(dt(self.start_date.year, self.start_date.month, 1)) - return dates \ No newline at end of file + return dates