0

When I am using "Google App Script" in order to retrieve a json page, I face with the following message: Please turn JavaScript on and reload the page.

I am not sure how to handle this, hence I can open the same page on my web-browser.

[Q] How could I fix this in order retrieve json-page's information only using "Google App Script"?

function getJsonFromUrl(strUrl) {
  let _options = {
    method: 'GET',
    muteHttpExceptions: true,
    contentType: 'application/json',
  };
  let _res = UrlFetchApp.fetch(strUrl, _options);
  Logger.log(_res.getContentText());
  return JSON.parse(_res.getContentText());
}
Question-er XDD
  • 640
  • 3
  • 12
  • 27
  • Does this answer your question? [Using Apps Script to scrape javascript rendered web page](https://stackoverflow.com/questions/50124981/using-apps-script-to-scrape-javascript-rendered-web-page) – Kos Jan 30 '22 at 11:31
  • no, google app script seems cannot use puppeteer – Question-er XDD Jan 30 '22 at 13:51
  • There is no other way, of course if you have time to explain to Google why this is important feature, you can try create feature request here: https://issuetracker.google.com/ – Kos Jan 30 '22 at 14:01
  • To what link are you executing the fetch? is it a javascript page? – Kessy Jan 31 '22 at 13:20
  • When you track the network traffic, you will know the issue – Question-er XDD Feb 02 '22 at 02:22

1 Answers1

0

As mentioned in the comment #3 and verified with the URL provided:

There is no other way, of course if you have time to explain to Google why this is important feature, you can try create feature request here: issuetracker.google.com

You can use the following template to create the feature request:

Kessy
  • 1,894
  • 1
  • 8
  • 15