Friday, 9 June 2017

Nodejs Cheerio attribute selector

I want to use the following selector normally found in jQuery to create a function that works on its children:

var useroverviewHook = $("div[data-pnref='overview'] *[data-overviewsection]");   

However, it is not working in Cheerio. Nodejs console is reporting

console.log($(useroverviewHook).length) is 0

even tough if testing in the browser, the value is not 0, multiple elements exists.



via CristianC

No comments:

Post a Comment