Import querySelector function
Hello, I was wondering if could I import such function like querySelector or querySelectorAll to use it inside function node? I've tried with: var doc = msg.payload; var querySelector =...
View ArticleImport querySelector function
querySelector is not a defined function in node.js - its a browser specific feature. There are npm modules available to provide similar functionality, such as cheerio you could add via...
View ArticleImport querySelector function
Thank you, but I would like to import a whole html page inside msg.payload then assigne some string to variables using css selectors in one function node using for example querySelector function. So...
View ArticleImport querySelector function
wojtula: So should I install npm cheerio gloabally then import it? You should following the docs for loading additional modules here: Redirecting… Read full topic
View ArticleImport querySelector function
ok, thank you. I installed https://www.npmjs.com/package/query-selector then add line to settings.js: functionGlobalContext: { qs:require('query-selector') // os:require('os'), //...
View ArticleImport querySelector function
From the readme of the query-selector module you have chosen shows it has to be used alongside jsdom: var querySelectorAll = require('query-selector'); var jsdom = require("jsdom").jsdom; var doc =...
View ArticleImport querySelector function
ok i see... ok jsdom installed and added: functionGlobalContext: { qs:require('query-selector') jsdom:require('jsdom') // os:require('os'), // jfive:require("johnny-five"), //...
View ArticleImport querySelector function
Did you modify your Function to match? (and when sharing code please follow the guidance in this post: How to share code or flow json) Read full topic
View ArticleImport querySelector function
sure: var doc = msg.payload; var qs = global.get('qs'); var jsdom = global.get('jsdom'); doc.qs("p");...
View ArticleImport querySelector function
So you import jsdom into your function, but you haven't used it. Look again at the query-selector example code. Look at where its doc variable comes from. (and please use the ``` quotes around blocks...
View ArticleImport querySelector function
Ok, I installed cherio as you recommend. Another problem:...
View ArticleImport querySelector function
var doc = msg.payload; //var qs = global.get('qs'); //var jsdom = global.get('jsdom'); //doc.qs("p"); global.get('cherio'); doc.nextAll('p') I don't see any code using cheerio. In the same way you...
View Article
More Pages to Explore .....