google-play-scraper
google-play-scraper copied to clipboard
Search is again stop working
- 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')
It works for a 40% chance. I suggest u use a try-catch and loop the search until you get the results.
Having the same issue with some calls, but yea, workaround seems to loop until it works, just not really efficient.
Adding loop will definitely work but Is there any long term solution?
Depends in anyone finds a solution to the problem. @facundoolano
https://github.com/facundoolano/google-play-scraper/compare/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"
@Djip, how about opening a PR with your change? :)
@Djip, how about opening a PR with your change? :)
As mentioned, i'm not 100% sure this works every time
@facundoolano Any update?
I have a same issue. and fix that with try catch loop until it works.
@Djip, I am happy to give it a test drive if you open a PR with the change. :)
I opened a PR with your change @Djip, it works perfectly fine for me. @facundoolano, can you please look into it? Thanks a lot! https://github.com/facundoolano/google-play-scraper/pull/600
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