Tag: zapier

无法使用getElementsByTagName(“body”)

这是每次运行时都会导致错误的代码。 我的目标是从URL中删除内容,删除所有的HTML,并返回: console.log("Fetching: " + inputData.tweeturl); fetch(inputData.tweeturl) .then(function(res) { return res.text(); }).then(function(body) { var rawText = body.getElementsByTagName("body")[0].innerHTML; var output = { id: 100, rawHTML: body, rawText: rawText }; callback(null, output); }) .catch(callback); 问题是var rawText = body.getElementsByTagName("body")[0].innerHTML; 我收到的错误是: Bargle。 我们碰到一个错误,创build一个运行的JavaScript。 🙁 Error:TypeError:body.getElementsByTagName is not a function eval(eval at(/var/task/index.js:52:23),:16:24)process._tickDomainCallback(node.js:407:9)

找不到模块'nodemailer'

我正在使用Zapier代码应用程序,我需要发送一个电子邮件接收trello参数,我正在使用javascript编码与node.js,但是当我试图findnodemailer模块时,我总是得到它不能被发现 .. 。 错误总是指向这行代码: Var nodemailer = require ('nodemailer');

如何在“Zapier代码”中编写node-fetch(Rest-API)?

在zapier中,我使用了Code By Zapier的一个动作。 它基于node.js。 我需要使用提取来实现我的CRM的REST-API。 这里是我写的代码,运行良好,当我用VS代码(Zapier之外)尝试它时: // the code by zapier includes already the require('fetch') var api_token = "…"; // my api var deal_name = "Example"; // a string fetch("https://api.pipedrive.com/v1/deals/find?term="+deal_name+"&api_token=" + api_token) .then(function(res) { return res.json(); }).then(function(json) { var deal_id = json.data[0].id; console.log("deal_id="+deal_id); }).catch(function(error) { console.log("error"); }); output = {id: 1, hello: "world"}; // must […]