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 902efff commit c33ea94
Showing 4 changed files with 506 additions and 506 deletions.
4 changes: 2 additions & 2 deletions japan_avg_hotel_price_finder/graphql_scraper.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
from japan_avg_hotel_price_finder.configure_logging import configure_logging_with_file

logger = configure_logging_with_file('jp_hotel_data.log', 'jp_hotel_data')
logger.setLevel(level="INFO")
logger.setLevel(level="DEBUG")


def get_header() -> dict:
@@ -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'][0]['blocks'][1]['finalPrice']['currency']
currency_data = entered_selected_currency

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

0 comments on commit c33ea94

Please sign in to comment.