Skip to content

Commit

Permalink
Add error printing for coles.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Javex committed Sep 26, 2023
1 parent 590d1d6 commit 544fd3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion coles.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def get_category(self, cat_slug):
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.raise_for_status()
try:
response.raise_for_status()
except requests.HTTPError:
print(response.text)
raise
response_data = response.json()
search_results = response_data['pageProps']['searchResults']
for result in search_results['results']:
Expand Down

0 comments on commit 544fd3a

Please sign in to comment.