Hi guys,
not sure if I can run this on an n8n function node to get the results and use them in the following steps?
(how to wait for the promise to finish ?)
var nodeHtmlCrawler = require("node-html-crawler")
const domain = 'n8n.io';
const crawler = new nodeHtmlCrawler(domain);
crawler.crawl();
crawler.on('data', (data) => console.log(data.result.statusCode, data.url));
crawler.on('error', (error) => console.error(error));
crawler.on('end', () => console.log(`Finish! All urls on domain ${domain} a crawled!`));
(component here: node-html-crawler - npm)
Thanks!!!