Skip to content

Commit

Permalink
v4.4.1
Browse files Browse the repository at this point in the history
- Added IndexError handler when finding currency data from GrapQL response JSON
  • Loading branch information
sakan811 committed Jun 17, 2024
1 parent d5f7000 commit 902efff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion japan_avg_hotel_price_finder/graphql_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def check_info(
try:
currency_data = data['data']['searchQueries']['search']['results'][0]['blocks'][0]['finalPrice']['currency']
except IndexError:
currency_data = data['data']['searchQueries']['search']['results'][1]['blocks'][0]['finalPrice']['currency']
currency_data = data['data']['searchQueries']['search']['results'][0]['blocks'][1]['finalPrice']['currency']

if entered_city != city_data:
logger.error(f"Error City not match: {entered_city} != {city_data}")
Expand Down

0 comments on commit 902efff

Please sign in to comment.