Javascript 类型错误:semrush.backlinks\u refdomains不是函数
伙计们,当我试图使用反向链接和反向链接从SEMRUSH API获取数据时,它向我显示了这个错误 当我调用同一个函数domain_rank时,它以json格式响应我。你能帮我解决这个问题吗。附加图像是当它给我域_排名时的结果,但不是其他因素,如链接等。 我正在使用这个代码Javascript 类型错误:semrush.backlinks\u refdomains不是函数,javascript,node.js,api,sails.js,Javascript,Node.js,Api,Sails.js,伙计们,当我试图使用反向链接和反向链接从SEMRUSH API获取数据时,它向我显示了这个错误 当我调用同一个函数domain_rank时,它以json格式响应我。你能帮我解决这个问题吗。附加图像是当它给我域_排名时的结果,但不是其他因素,如链接等。 我正在使用这个代码 ` module.exports = { index: function(req,res){ console.log("Hello welocme!"); var SEMRushAPI = require('
`
module.exports = {
index: function(req,res){
console.log("Hello welocme!");
var SEMRushAPI = require('sails-semrush');
var URL = "www.flipkart.com";
var database = {database:'us'};
var semrush = new SEMRushAPI('XXXXXXXXXXXXXXX');
semrush.backlinks(URL, database, function(err, response){
if (err){
console.log("There is some error to fetching web traffic on API !");
console.log("err: ",err);
console.log("There is some error to fetching web traffic on API !");
}else{
console.log("backlinks");
console.log(" Response: ",response);
console.log("**************** Get the web traffic successfully ***************");
console.log("******zone, country, ip*******");
}
semrush.backlinks_refdomains(URL, database, function(err, response){
if (err){
console.log("There is some error to fetching web traffic on API !");
console.log("err: ",err);
console.log("There is some error to fetching web traffic on API !");
}else{
console.log("domain_score_asc, domain_score_desc, backlinks_asc, backlinks_desc, last_seen_asc, last_seen_desc, first_seen_asc, first_seen_desc");
console.log(" Response: ",response);
console.log("**************** Get the web traffic successfully **************");
console.log("zone, country, ip");
}
});
`
提前谢谢 是否尝试关闭()函数
缺少括号“)”:
1) 反向链接(URL、数据库、函数(错误、响应){
尝试修复它:
反向链接(URL、数据库、函数(错误、响应)){
2) semrush.backlinks\u refdomains(URL、数据库、函数(错误、响应){
尝试修复它:
semrush.backlinks\u refdomains(URL、数据库、函数(错误、响应)){您好,谢谢您的回复,我也尝试过使用您的代码,但没有成功!错误显示:TypeError:semrush.backlinks\u refdomains不是一个函数如果我正确理解,手动操作可以很好地工作,但是在c中ode不是?在这种情况下,你应该问“sails semrush”的开发人员为什么会发生这种情况。我怎么看你已经从他们那边得到了问题的答案>,括号中没有问题,如果是,它应该给出错误,如SyntaxError:Unexpected token,但在我的情况下,它给出的是不同的。这意味着我的代码是fineYes@ivan但对于节点semrush,它也没有响应,根据您的文档,在某些情况下调用API的过程是相同的。但在其他因素中,它有响应但没有反向链接Shello ivan您是否发现了问题所在。虽然我用两个进程调用了API。但仍然站在同一页上。