无法在Google Apps脚本中使用fetchURL() [英] Unable to use fetchURL() in Google apps scripts

查看:51
本文介绍了无法在Google Apps脚本中使用fetchURL()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Google Apps脚本中调用以下网址.在我的浏览器中,它工作正常,但是从Apps脚本运行时,出现错误访问被拒绝".

I am trying to call the below URL from Google apps script. In my browser it works fine, but when run from Apps script I get the error 'Access denied'.

var response=UrlFetchApp.fetch(url);//Fails with Access denied exception

URL:以JSON格式获取股票数据

'对 http://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/ajaxGetQuoteJSON.jsp?symbol=AXISBANK&ser​​ies=EQ 返回代码403.服务器响应被截断:拒绝访问

拒绝访问

您无权访问"http://www.ns ...(使用MutantHttpExceptions选项检查完整响应)"

'Request failed for http://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/ajaxGetQuoteJSON.jsp?symbol=AXISBANK&series=EQ returned code 403. Truncated server response: Access Denied

Access Denied

You don't have permission to access "http://www.ns... (use muteHttpExceptions option to examine full response)'

我需要做些额外的事情吗?

Do i need to do anything extra?

推荐答案

状态403表示一切均按计划进行,但收件人拒绝了该请求.没有宿主站点的明确说明,很难说为什么拒绝请求,但是可能是由于代码问题而导致请求被拒绝的原因,或者它们可能有适当的服务来阻止此类请求的发生.未经授权的IP.

Status 403 indicates that everything went as planned, but the recipient denied the request. Without clarification from the host site, it's hard to say why it's rejecting the request, but it could be anything from the request being denied due to an issue with your code, or they may have a service in place that prevents these kinds of requests from unauthorized IPs.

由于您所连接的网站的性质以及被滥用的可能性,他们甚至可能已将Google应用程序脚本列入了黑名单.

They may even have blacklisted Google apps script specifically, due to the nature of the site you're connecting too, and the potential for abuse.

这篇关于无法在Google Apps脚本中使用fetchURL()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆