data_collection/gazette/spiders/pb_joao_pessoa.py
def parse(self, response):
        """Parses gazettes page and requests next page.

        Normal gazettes are displayed in a weekly basis, so, the date which is taken
        into account for this type of gazette is the last in the publication period
        (i.e. "29/08/2020" from "23/08/2020 to 29/08/2020").

        Special gazzetes are daily, but that same logic applies here and it works
        correctly.
        """
        gazettes = response.css(".table-semanarios table tbody tr")
        for gazette in gazettes:
            url = gazette.css("td:last-child a::attr(href)").get()
            gazette_date = (
                gazette.css("td:nth-last-child(2)::text")
                .re(r"[0-9]{2}/[0-9]{2}/[0-9]{4}")
                .pop()
            )
            gazette_date = datetime.datetime.strptime(gazette_date, "%d/%m/%Y").date()
            is_extra = "Especial" in gazette.css("td:first-child").get()

            yield Gazette(
                date=gazette_date,
                file_urls=[url],
                is_extra_edition=is_extra,
                power="executive_legislative",
            )

        for url in response.css(".pagination a.next::attr(href)").getall():
            yield response.follow(url)
Parses gazettes page and requests next page.

        Normal gazettes are displayed in a weekly basis, so, the date which is taken
        into account for this type of gazette is the last in the publication period
        (i.e. "29/08/2020" from "23/08/2020 to 29/08/2020").

        Special gazzetes are daily, but that same logic applies here and it works
        correctly.
        
Parses gazettes page and requests next page.
Normal gazettes are displayed in a weekly basis, so, the date which is taken
into account for this type of gazette is the last in the publication period
.

Special gazzetes are daily, but that same logic applies here and it works
correctly.
Parses gazettes page and requests next page . Normal gazettes are displayed in a weekly basis so the date which is taken into account for this type of gazette is the last in the publication period . Special gazzetes are daily but that same logic applies here and it works correctly .
def parse(self, response):
        gazettes = response.css(".table-semanarios table tbody tr")
        for gazette in gazettes:
            url = gazette.css("td:last-child a::attr(href)").get()
            gazette_date = (
                gazette.css("td:nth-last-child(2)::text")
                .re(r"[0-9]{2}/[0-9]{2}/[0-9]{4}")
                .pop()
            )
            gazette_date = datetime.datetime.strptime(gazette_date, "%d/%m/%Y").date()
            is_extra = "Especial" in gazette.css("td:first-child").get()
            yield Gazette(
                date=gazette_date,
                file_urls=[url],
                is_extra_edition=is_extra,
                power="executive_legislative",
            )
        for url in response.css(".pagination a.next::attr(href)").getall():
            yield response.follow(url)
def parse ( self , response ) : gazettes = response . css ( ".table-semanarios table tbody tr" ) for gazette in gazettes : url = gazette . css ( "td:last-child a::attr(href)" ) . get ( ) gazette_date = ( gazette . css ( "td:nth-last-child(2)::text" ) . re ( r"[0-9]{2}/[0-9]{2}/[0-9]{4}" ) . pop ( ) ) gazette_date = datetime . datetime . strptime ( gazette_date , "%d/%m/%Y" ) . date ( ) is_extra = "Especial" in gazette . css ( "td:first-child" ) . get ( ) yield Gazette ( date = gazette_date , file_urls = [ url ] , is_extra_edition = is_extra , power = "executive_legislative" , ) for url in response . css ( ".pagination a.next::attr(href)" ) . getall ( ) : yield response . follow ( url )
Parses gazettes page and requests next page.
Parses gazettes page and requests next page .
"""Parses gazettes page and requests next page.

        Normal gazettes are displayed in a weekly basis, so, the date which is taken
        into account for this type of gazette is the last in the publication period
        (i.e. "29/08/2020" from "23/08/2020 to 29/08/2020").

        Special gazzetes are daily, but that same logic applies here and it works
        correctly.
        """
self
response