Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

similar API returns a wrong list #607

Open
winhows5 opened this issue Nov 11, 2022 · 1 comment
Open

similar API returns a wrong list #607

winhows5 opened this issue Nov 11, 2022 · 1 comment

Comments

@winhows5
Copy link

winhows5 commented Nov 11, 2022

  • Operating System: MacOS
  • Node version: v18.12.1
  • google-play-scraper version: [email protected]

Description:

The similar API returns a wrong list for some apps. This list tends to be the developer apps.

Please see the testcase below. Both of them return a same app list.

Example code:

// Put code to reproduce the issue here
gplay.similar({appId: "com.codeway.wonder"}).then(console.log);
gplay.developer({devId: "Codeway Dijital"}).then(console.log);
@winhows5
Copy link
Author

winhows5 commented Nov 11, 2022

This bug is caused when there's a column called "More by this developer" before "Similar apps", in which case the similar app item index is shifted.

Hence I temporarily fixed it by adding these code to lib/similar.js:75:

  // Temp fix for wrong similar apps =========================
  let similarAppsCluster = clusters.filter(cluster => {
    return R.path(CLUSTER_MAPPING.title, cluster) === SIMILAR_APPS;    // note: I don't concern the game category
  });

  if (similarAppsCluster.length === 0) {
    throw Error('Similar apps not found');
  }
  const clusterUrl = getParsedCluster(similarAppsCluster[0]);
  // End of fix=========================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant