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

Cross-Origin Request Blocked #362

Closed
yogiprsetya opened this issue Oct 15, 2019 · 4 comments
Closed

Cross-Origin Request Blocked #362

yogiprsetya opened this issue Oct 15, 2019 · 4 comments

Comments

@yogiprsetya
Copy link

@yogiprsetya yogiprsetya commented Oct 15, 2019

  • Operating System: Windows 10
  • Node version: 12.4.0
  • google-play-scraper version: 7.0.4

Description:

I have issues with Cross-Origin Request Blocked error.

Example code:

var gplay = require('google-play-scraper');
gplay.app({appId: 'com.oriente.finmas'}).then(console.log);

Error message:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://play.google.com/store/apps/details?id=com.oriente.finmas&hl=en&gl=us. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)

We have done

create vue.config.js
and write

module.exports = {
    devServer: {
        proxy: 'https://play.google.com/',
    }
}

and error accured with message:
Error: Error requesting Google Play:NetworkError when attempting to fetch resource.

@facundoolano

This comment has been minimized.

Copy link
Owner

@facundoolano facundoolano commented Oct 15, 2019

Are you running this library from the browser?

@yogiprsetya

This comment has been minimized.

Copy link
Author

@yogiprsetya yogiprsetya commented Oct 15, 2019

Are you running this library from the browser?

yes, on localhost

@facundoolano

This comment has been minimized.

Copy link
Owner

@facundoolano facundoolano commented Oct 15, 2019

This is not supposed to run from the browser. AFAIK you can't avoid that CORS issue, maybe someone else knows how to handle it.

@yurganov

This comment has been minimized.

Copy link
Contributor

@yurganov yurganov commented Oct 15, 2019

There is what you can do:

  • Run local server on node.js on some port, write some handler that return you result of some function of this library, and access this handler from browser
  • install some plugin for your browser that enable CORS

https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.