Skip to content

Commit

Permalink
Atualiza formato de url para base Instar (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
trevineju authored Jun 12, 2024
2 parents 0c818b4 + e2234f1 commit 640a3e8
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions data_collection/gazette/spiders/base/instar.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@ def start_requests(self):
start_date = self.start_date.strftime("%d-%m-%Y")
end_date = self.end_date.strftime("%d-%m-%Y")

start_url = "{base_url}/{page}/{start_date}/{end_date}/0/0/0".format(
**{
"base_url": self.base_url,
"page": page,
"start_date": start_date,
"end_date": end_date,
}
)
start_url = f"{self.base_url}/{page}/{start_date}/{end_date}/0/0/"

yield scrapy.Request(
start_url,
cb_kwargs={"page": page, "start_date": start_date, "end_date": end_date},
Expand All @@ -34,15 +28,9 @@ def _pagination_requests(self, response, page, start_date, end_date):

for next_page in range(2, total_pages + 1):
next_page_url = (
"{base_url}/{page}/{start_date}/{end_date}/0/0/0".format(
**{
"base_url": self.base_url,
"page": next_page,
"start_date": start_date,
"end_date": end_date,
}
)
f"{self.base_url}/{next_page}/{start_date}/{end_date}/0/0/"
)

yield scrapy.Request(
next_page_url,
cb_kwargs={
Expand Down

0 comments on commit 640a3e8

Please sign in to comment.