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

Search is again stop working #596

Open
rsutariy opened this issue Oct 4, 2022 · 12 comments
Open

Search is again stop working #596

rsutariy opened this issue Oct 4, 2022 · 12 comments

Comments

@rsutariy
Copy link

rsutariy commented Oct 4, 2022

  • Operating System:MacOS 12.4 and Amazon Linux 2
  • Node version:16.16.0
  • google-play-scraper version:9.1.1

Description:

Search is not working properly. It throws an error more than corrected result for same keyword.
keywords examples : Facebook, Walmart etc..

Example code:

gplay.search({
    term: "facebook",
    num: 2
  }).then(console.log, console.log);

Error message:

Error TypeError: Cannot read properties of undefined (reading 'map')
@ansoncen
Copy link

ansoncen commented Oct 6, 2022

It works for a 40% chance. I suggest u use a try-catch and loop the search until you get the results.

@Djip
Copy link

Djip commented Oct 6, 2022

Having the same issue with some calls, but yea, workaround seems to loop until it works, just not really efficient.

@rsutariy
Copy link
Author

rsutariy commented Oct 6, 2022

Adding loop will definitely work but Is there any long term solution?

@Djip
Copy link

Djip commented Oct 6, 2022

Depends in anyone finds a solution to the problem. @facundoolano

@Djip
Copy link

Djip commented Oct 7, 2022

main...Djip:google-play-scraper:main#diff-5fa3e79ff4f9f5b6d3a08d3abab2c8db53823a6b1e36d9ecd723792890870aaf

I've made these changes in my local fork, and it seems to work fine, but haven't had too much time to test it in different scenarios.

Note:
Looping only seemed to work for a little bit of time. Perhaps cause some of the servers being hit still were on the old patch, but now most of them is on the "new"

@CyrilCermak
Copy link

@Djip, how about opening a PR with your change? :)

@Djip
Copy link

Djip commented Oct 10, 2022

@Djip, how about opening a PR with your change? :)

As mentioned, i'm not 100% sure this works every time

@rsutariy
Copy link
Author

@facundoolano Any update?

@insungson
Copy link

insungson commented Oct 13, 2022

I have a same issue. and fix that with try catch loop until it works.

@CyrilCermak
Copy link

@Djip, I am happy to give it a test drive if you open a PR with the change. :)

@CyrilCermak
Copy link

CyrilCermak commented Oct 16, 2022

I opened a PR with your change @Djip, it works perfectly fine for me. @facundoolano, can you please look into it? Thanks a lot!
#600

@jbigman
Copy link
Contributor

jbigman commented Jul 27, 2023

Fixed with PR #645

This part was incorrect :
return R.is(String, sectionTitle) && (R.isEmpty(sectionTitle)

The string could be empty or "Apps" (lang : en), "Applications" (lang : fr)...

In PR#645, i changed the code with
return R.is(String, sectionTitle) && (R.isEmpty(sectionTitle)

It seems to work perfectly

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

6 participants