0
私はPhantomJS内で$ .getJSONを使用しようとしていますが、その結果を得ることは不可能です。どんな解決策ですか?私は単純に直接読み込むことはできません。ページは同じドメインから呼び出される必要があります。PhantomJS getJSONが応答を取得できません
私はページを開いてそこから電話したいと思います。任意の助け
var jqueryUrl = "https://code.jquery.com/jquery-latest.min.js";
page.open("http://www.example.com/", function(status) {
if (status === "success") {
page.includeJs(jqueryUrl, function() {
var result = page.evaluate(function() {
$.getJSON('http://www.example.com/someJson', function(data) {
return data;
});
});
console.log(result);
phantom.exit();
});
} else {
phantom.exit(1);
}
});
ありがとう:ここ
が動作していない私の現在のコードです!
-error.html)ハンドラを使用してエラーをチェックします。 – Vaviloff