【发布时间】:2017-01-19 00:28:57
【问题描述】:
说网址是:https://api.github.com/users/mralexgray/repos
我只是想提取“html_url”键的所有键:值对。
我一直在尝试使用以下内容:
function extractJSON() {
$.ajax({
url: "https://api.github.com/users/mralexgray/repos",
dataType: 'json',
success: function(data) {
alert(data.html_url);
return data.html_url;
};
});
// casperjs begins below
casper.start(https://api.github.com/users/mralexgray/repos, function() {
});
casper.then(function() {
var output = this.evaluate(extractJSON());
this.echo(output);
});
casper.run();
感谢您抽出宝贵的时间!
【问题讨论】:
标签: javascript json casperjs