From b6f0421ab626b7777e7b8b13bc6da2d15f4c0961 Mon Sep 17 00:00:00 2001 From: javex Date: Tue, 3 Oct 2023 18:26:05 +1030 Subject: [PATCH] Update Coles API Endpoint for categories The API Endpoint for Coles contains a version and when they update it, our scraper breaks. This quickly updates the version, but we need to fetch it dynamically if we want scraping to be more stable. --- hotprices_au/sites/coles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotprices_au/sites/coles.py b/hotprices_au/sites/coles.py index a07f305..86c16a5 100644 --- a/hotprices_au/sites/coles.py +++ b/hotprices_au/sites/coles.py @@ -41,7 +41,7 @@ def get_category(self, cat_slug): product_count = 0 while True: print(f'Page {params["page"]}') - response = self.session.get(f'https://www.coles.com.au/_next/data/20230922.01_v3.52.0/en/browse/{cat_slug}.json', params=params) + response = self.session.get(f'https://www.coles.com.au/_next/data/20231002.02_v3.53.0/en/browse/{cat_slug}.json', params=params) try: response.raise_for_status() except requests.HTTPError: