data_collection/gazette/spiders/pr_curitiba.py
def fetch_years(self, response):
        """Requests pages for all available years."""
        years_available = response.xpath(
            "//select[@id='ctl00_cphMasterPrincipal_ddlGrAno']/option/@value"
        ).getall()
        for year in years_available:
            yield scrapy.FormRequest.from_response(
                response,
                formdata={"ctl00$cphMasterPrincipal$ddlGrAno": str(year)},
                meta={"year": int(year)},
                callback=self.parse_year,
            )
Requests pages for all available years.
Requests pages for all available years.
Requests pages for all available years .
def fetch_years(self, response):
        years_available = response.xpath(
            "//select[@id='ctl00_cphMasterPrincipal_ddlGrAno']/option/@value"
        ).getall()
        for year in years_available:
            yield scrapy.FormRequest.from_response(
                response,
                formdata={"ctl00$cphMasterPrincipal$ddlGrAno": str(year)},
                meta={"year": int(year)},
                callback=self.parse_year,
            )
def fetch_years ( self , response ) : years_available = response . xpath ( "//select[@id='ctl00_cphMasterPrincipal_ddlGrAno']/option/@value" ) . getall ( ) for year in years_available : yield scrapy . FormRequest . from_response ( response , formdata = { "ctl00$cphMasterPrincipal$ddlGrAno" : str ( year ) } , meta = { "year" : int ( year ) } , callback = self . parse_year , )
Requests pages for all available years.
Requests pages for all available years .
"""Requests pages for all available years."""
self
response