【问题标题】:YQL Console: No definition found for Table htmlstringYQL 控制台:找不到表 htmlstring 的定义
【发布时间】:2017-08-24 10:38:48
【问题描述】:

我不知道雅虎在晚上是否改变了一些东西,但昨天有效的东西今天没有...

因此,如果您尝试this,它将起作用并从 Google 主页返回预期的 HTML。

如果您尝试this,它也会按预期工作。

现在,如果我尝试使用 JavaScript 调用 YQL 控制台提供的 REST 查询来进行调用,我会收到以下消息:

{"error": {
  "description": "No definition found for Table htmlstring",
  "diagnostics": {"url": {
    "content": "http://www.datatables.org/data/htmlstring.xml",
    "execution-stop-time": "1",
    "http-status-message": "Bad Request",
    "execution-time": "1",
    "http-status-code": "400",
    "execution-start-time": "0"
  }},
  "lang": "en-US"
}}

这是我使用的 JavaScript:

var createCORSRequest=function(method, url) {
  var xhr = new XMLHttpRequest();
  if ("withCredentials" in xhr) {
    // XHR for Chrome/Firefox/Opera/Safari.
    xhr.open(method, url, true);
  } else if (typeof XDomainRequest != "undefined") {
    // XDomainRequest for IE.
    xhr = new XDomainRequest();
    xhr.open(method, url);
  } else {
    // CORS not supported.
    xhr = null;
  }
  return xhr;
}

// Make an actual CORS request.
var makeCorsRequest=function(url) {
  var deferred=jQuery.Deferred();
  var xhr = createCORSRequest('GET', url);
  if (!xhr) {
    deferred.fail('CORS not supported');
    return;
  }
  // Response handlers.
  xhr.onload = function() {
    deferred.resolve(JSON.parse(xhr.responseText));
  };
  xhr.onerror = function() {
    deferred.fail('Woops, there was an error making the request.');
  };
  xhr.send();
  return deferred;
}

var resturl = "https://query.yahooapis.com/v1/public/yql?q=env%20%22store%3A%2F%2Fdatatables.org%2Falltableswithkeys%22%3B%20select%20*%20from%20htmlstring%20where%20url%3D%22https%3A%2F%2Fwww.google.com%22&format=json&diagnostics=true&callback=";
makeCorsRequest(resturl).then(function(data) {
  console.log(data)
})

旁注:在 YQL 控制台上它几乎一直有效,但我收到了一些失败。所以我想知道YQL是否中断了?

【问题讨论】:

  • 这里一样,它时不时地工作.. 给我 HTTP 状态 400,大部分时间都是错误的请求。 YQL 整年都运行良好,这是我第一次遇到问题。希望它会尽快得到解决。
  • 好像他们已经结束了对 htmlstring 的支持
  • 您的问题有答案了吗?我也收到此错误。 @AymKdn
  • No answer found....我认为服务正在慢慢死去,所以我用完自己的服务器

标签: javascript yql yahoo-api


【解决方案1】:

我不知道这是否相关,但我认为他们已被黑客入侵,看看这个,他们服务器中的另一个标题。奇怪的链接:Yahoo

【讨论】:

    【解决方案2】:

    我不知道这是否相关,但 YQL 控制台无法返回 RSS 查询的结果。
    例如,这会失败:

    select * from rss where url="http://razamazazzle.blogspot.com/feeds/posts/default"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-08
      相关资源
      最近更新 更多