question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Incorrect response with empty/wrong fields

See original GitHub issue

google_play_scraper.VERSION 1.0.5

Describe the bug Sometimes the library returns the incorrect response with empty/wrong fields.

Code google_play_scraper.app(“com.android.chrome”, lang=“en”, country=“us”)

Response:

{
  'title': [],
  'description': None,
  'descriptionHTML': None,
  'summary': None,
  'summaryHTML': None,
  'installs': None,
  'minInstalls': None,
  'score': None,
  'ratings': None,
  'reviews': None
  ...
  'appId': 'com.android.chrome',
  'url': 'https://play.google.com/store/apps/details?id=com.android.chrome&hl=en&gl=us'
}

image

Additional context I tested this with different applications and it turned out that it’s not application dependent. It started on May 12th. I think Google Play is testing some feature as part of A/B testing.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
JoMingyucommented, May 27, 2022

It fixed at version 1.1.0. It really hard to fix. I need to make a data path finder.

related commit: https://github.com/JoMingyu/google-play-scraper/commit/d53bbf383b93a5e9ece0a22eae9176449a646227

3reactions
kuwapacommented, May 22, 2022

Hello,

I was facing this same issue happening on an irregular basis. On fetching the same app again after a while it often worked and sometimes it didn’t. Initially I thought this error was because of some rate limiting by google wherein the webpage was showing some captcha or maybe returning a 429 Too many requests response code?. So I started just adding a delay to the script after I got a response with null values in it. However, I dug in a little deeper.

I added the following code in request.py.

...
def _urlopen1(obj):
    try:
        resp = urlopen(obj)
        print("response_code = " + str(resp.code))
        package_name = obj.replace("https://play.google.com/store/apps/details?id=", "").replace("&hl=en&gl=us",
                                                                                                 "").replace(".", "_")
        text_file = open("/Users/abhimanyu/Projects/PlayStoreScreenshots/testfiles/" + package_name + ".html", "w")
        text_file.write(str(resp.read()))
        text_file.close()
        filename = 'file:////Users/abhimanyu/Projects/PlayStoreScreenshots/testfiles/' + package_name + ".html"
        webbrowser.open_new_tab(filename)
        # print(str(resp.read()))
        resp = urlopen(obj)
    except HTTPError as e:
...

So now as I looped through many apps, I was seeing the response code for each request and also each request was saving the raw webpage on the file system and opening it in the browser so that I could see what exactly was google’s server’s returning.

I noticed 3 things.

  1. On the apps where the response had null values, the response code was still 200 meaning that was not due to rate limiting by Google.
  2. A new design? I thought this was the cause of the issue? A new webpage that perhaps Google is AB testing as @SprutSDM mentioned? But this was not the cause of the issue. Even these new looking webpages were being parsed fine and not retuning null values.
  3. Regular looking webpages but with weird data. These are the pages which were returning null values. I’ve attached a screenshot of this. I’m not yet sure why is this happening and how can it be fixed. Perhaps @89z can shed some light on this? How did you fix this in your own repository?

New design (not source of problem)

Screen Shot 2022-05-23 at 12 55 36 AM

Webpage with weird text (Source of problem)

Screen Shot 2022-05-23 at 12 42 14 AM

I hope this helps shed more light on the issue and can help in fixing the issue sooner. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"message" field is empty in error response Spring Boot
I tried using, throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Invalid credentials");. but the result is ...
Read more >
Solved: Include the Missing Fields in Error Response
Solved: Hi, I just want to include the fields that are null in my error response. Any suggestion? Sample request { "username": ""...
Read more >
How to display an empty field in an error message - ServiceNow
The following script now displays an error message indicating that there is an empty field. The function itself is working, but there are...
Read more >
Response with empty body - is this a problem? - jQuery Forum
An empty response is OK, unless you are getting JSON format. In which case it gets 200, and it is an error.
Read more >
Optional people picker field throwing error whene... - Power ...
Optional people picker field throwing error whenever left empty , error doesnt happen when a name is selected . " The requested operation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found