Skip to content

Commit

Permalink
Update Coles API Endpoint for categories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Javex committed Oct 3, 2023
1 parent eb5bb07 commit b6f0421
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hotprices_au/sites/coles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b6f0421

Please sign in to comment.