Open TravisWhitehead opened 4 years ago
@TravisWhitehead you are right These collections work only without any category. For example, the following codes are valid:
```javascript gplay.list({ collection: gplay.collection.TOP_FREE_GAMES, num: 10, }) gplay.list({ collection: gplay.collection.TOP_PAID_GAMES, num: 10, }) ```
That's because these collections access the main Google Play Top page: https://play.google.com/store/apps/top/?hl=en&gl=us
When you add any category, it tries to access the Google Play Top category page for example: https://play.google.com/store/apps/top/category/ENTERTAINMENT?hl=en&gl=us
```javascript gplay.list({ collection: gplay.collection.TOP_FREE_GAMES, category: gplay.category.ENTERTAINMENT, num: 10, }) ```
And that page have no "Top Free Games" cluster, raising the error that you mentioned:
The same goes for NEW_FREE_GAMES
and NEW_PAID_GAMES
Maybe this should be documented inside the README
Description:
It appears that four of the collections are invalid for every category. Every category I try for these collections triggers this error: https://github.com/facundoolano/google-play-scraper/blob/2230e30652411697f6474dbe2a2090fd034a9a2e/lib/utils/parseCategoryApps.js#L51
Example code:
Run the below using
node bad_collection.js | tee output
(tee is optional for saving output to file).You will see the error for every single category for each of these collections.
To quickly validate that there was not a single successful query: do
cat output | grep SUCCESS
. You can also docat output | grep FAIL | wc -l
and note that there are 236 failures. There are 59 categories and 4 collections, so59 * 4 = 236
(all combos fail).Error message:
This is the output I get when running the above example code: https://gist.github.com/TravisWhitehead/545b6f4737b527b0196059a84d6cf7d9
Depending on the collection used: