# \[new node\]: node-red-contrib-cheerio-function

**URL:** <https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982>\
**Category:** Developing Nodes\
**Created:** [1 August 2018 17:21 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982 "2018-08-01T17:21:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![t4skforce1337](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t4skforce1337/32/1491_2.png) [@t4skforce1337](https://discourse.nodered.org/u/t4skforce1337)\
**Post date:** [1 August 2018 17:21 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/1 "2018-08-01T17:21:51Z")

</div>

New node to be added to [https://flows.nodered.org](https://flows.nodered.org):

[https://www.npmjs.com/package/node-red-contrib-cheerio-function](https://www.npmjs.com/package/node-red-contrib-cheerio-function)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 August 2018 17:42 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/2 "2018-08-01T17:42:13Z")

</div>

Here is an example for using Cheerio with a Node-RED function. It should be easily adapted to your node since the example simply makes Cheerio available to a function node manually.

> **[How to extract a table from HTML](https://it.knightnet.org.uk/kb/nr-qa/extract-html-table.html)**
>
> While Node-RED has some nodes for extracting data from HTML, the nodes are rather simplistic. Here is a quick way to extract the data from an HTML table element.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 August 2018 18:05 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/3 "2018-08-01T18:05:30Z")

</div>

And the built in HTML node uses cheerio also.

---

<div class="post-metadata">

**Author:** ![t4skforce1337](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t4skforce1337/32/1491_2.png) [@t4skforce1337](https://discourse.nodered.org/u/t4skforce1337)\
**Post date:** [1 August 2018 18:34 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/4 "2018-08-01T18:34:15Z")

</div>

Thanks for the hint, this option was already known to me, but I wanted to have a palette based only install of a cario node, as it is not always possible to fiddle with settings.js and add globals. In my use case I run somewhere node-red based on a docker container and can't change local files just use web access alone.

---

<div class="post-metadata">

**Author:** ![t4skforce1337](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t4skforce1337/32/1491_2.png) [@t4skforce1337](https://discourse.nodered.org/u/t4skforce1337)\
**Post date:** [1 August 2018 18:40 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/5 "2018-08-01T18:40:10Z")

</div>

As for the HTML node, thx, didn't know that, cool. Still doesn't solve my problem in being as flexible as a function node. Would be really cool to have the option to change globals at runtime or with a deploy. And expose them directly without fiddling around the global.get()... in function node. Or have some sort of Node-Red config that can be edited from Web-UI to achieve something similar.

In the end, does this mean my node is not being accepted?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 August 2018 19:10 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/6 "2018-08-01T19:10:38Z")

</div>

Should be fine as long as packaged properly. But we have been having problems with npm not automatically indexing them properly recently and both Nick and I are on vacation so can’t kick manually at the moment.  
(Just pointing out that very similar functionality already exists so may not be necessary. Always good to propose/discuss on the forum before writing loads of code 🙂

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 August 2018 19:11 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/7 "2018-08-01T19:11:34Z")

</div>

(And better config options are on the todo list)

---

<div class="post-metadata">

**Author:** ![t4skforce1337](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t4skforce1337/32/1491_2.png) [@t4skforce1337](https://discourse.nodered.org/u/t4skforce1337)\
**Post date:** [1 August 2018 19:30 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/8 "2018-08-01T19:30:40Z")

</div>

Enjoy vacation 😃

And for better config options being on todo list 👍

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 August 2018 21:38 UTC](https://discourse.nodered.org/t/new-node-node-red-contrib-cheerio-function/1982/9 "2018-08-01T21:38:21Z")

</div>

> [@t4skforce1337](#):
>
> Thanks for the hint, this option was already known to me, but I wanted to have a palette based only install of a cario node, as it is not always possible to fiddle with settings.js and add globals. In my use case I run somewhere node-red based on a docker container and can't change local files just use web access alone.

I get the reasons and it makes for a neat solution anyway.

> [@t4skforce1337](#):
>
> option to change globals at runtime or with a deploy

This is easily done. Just put a suitable inject flow on the first tab. Make it fire on load. I do this with a number of key globals. The advantage of the settings file of course is that it _can't_ be changed by an admin user unless they have access to the file system. So it is good to have both options.

> [@t4skforce1337](#):
>
> In the end, does this mean my node is not being accepted?

It is an open source system so nobody can block you 🙂
