Skip to content

Commit 0039c4d

Browse files
committed
check for no results from search
1 parent 4318e08 commit 0039c4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

itunes_app_scraper/scraper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def get_app_ids_for_query(self, term, num=50, page=1, country="nl", lang="nl"):
5959
except json.JSONDecodeError:
6060
raise AppStoreException("Could not parse app store response")
6161

62+
if "bubbles" not in result or not result["bubbles"]:
63+
raise AppStoreException(f"No results found for search term {term} (country {country}, lang {lang})")
64+
6265
return [app["id"] for app in result["bubbles"][0]["results"][:amount]]
6366

6467
def get_app_ids_for_collection(self, collection="", category="", num=50, country="nl", lang=""):

0 commit comments

Comments
 (0)