Skip to content

Commit

Permalink
Handle null content in google_play_scraper
Browse files Browse the repository at this point in the history
If a content is extracted as null, instead of assigning it directly, we now use a fallback value
  • Loading branch information
Eitol committed May 11, 2024
1 parent 7152241 commit dd18c63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions google_play_scraper/features/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def parse_dom(dom: str, app_id: str, url: str) -> Dict[str, Any]:

for k, spec in ElementSpecs.Detail.items():
content = spec.extract_content(dataset)

result[k] = content
if content is None:
result[k] = spec.fallback_value
else:
result[k] = content

result["appId"] = app_id
result["url"] = url
Expand Down

0 comments on commit dd18c63

Please sign in to comment.