0

I am trying to get response from nseindia.com. From last month it's giving timeout error. Before that it worked perfectly. Do i have to use any additional methods? Did website put some kind of block?

function debugoc2(){
    var url = "https://www.nseindia.com/live_market/dynaContent/live_watch/option_chain/optionKeys.jsp?symbolCode=-10006&symbol=NIFTY&symbol=NIFTY&instrument=-&date=-&segmentLink=17&symbolCount=2&segmentLink=17";
    var response = UrlFetchApp.fetch(url,{muteHttpExceptions: true});
    var rc = response.getResponseCode();
    Logger.log(rc);
    var fileBlob = response.getBlob();
    var content = fileBlob.getDataAsString();
    Logger.log(content);
}
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Perhaps [this](https://stackoverflow.com/questions/38671314/extracting-a-table-in-google-apps-script-using-urlfetchapp)? – ADW Jan 01 '20 at 17:11
  • How long did it take? – Cooper Jan 01 '20 at 21:22
  • Hello @Srinivas Piccalo! I did try the code you provided but I am getting a `200 response`, so most likely the problem is not the code snippet you have shared. Have you tried it again? Are you calling the function somewhere else - if so, could you please those code snippets as well? Cheers! – ale13 Jan 02 '20 at 10:22
  • Thank you for trying the code. I observe it's not working during market times i.e 8:00 to 16:00 IST. Then i am getting timeout error after 60 seconds exactly. I think the website blocked me. Please tell me a workaround. – Srinivas Piccalo Jan 03 '20 at 01:25

0 Answers0