UNPKG

node-red-contrib-scrape-it

Version:
61 lines (57 loc) 1.88 kB
<script type="text/javascript"> RED.nodes.registerType('scrape',{ category: 'parser', color: '#a6bbcf', defaults: { name: {value:""}, mapping: {value:""} }, inputs:1, outputs:1, icon: "font-awesome/fa-code", label: function() { return this.name||"scrape"; }, oneditprepare: function(){ $("#node-input-mapping").typedInput({ type:"json", types:["json"] }); } }); </script> <script type="text/html" data-template-name="scrape"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-mapping"><i class="fa fa-arrows-h"></i> Mapping</label> <input type="text" id="node-input-mapping" placeholder="Mapping"> </div> </script> <script type="text/html" data-help-name="scrape"> <p>Scrape html request</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">string</span> </dt> <dd> the html to be parsed. </dd> </dl> <h3>Outputs</h3> <ol class="node-ports"> <li>html parsed to JSON <dl class="message-properties"> <dt>payload <span class="property-type">JSON</span></dt> <dd>html parsed as defined in mapping property</dd> </dl> </li> </ol> <h3>Details</h3> <p>Mapping property define how to transform html to JSON.</p> <h3>References</h3> <ul> <li><a href="https://github.com/cheeriojs/cheerio#-selector-context-root">Selectors section of the Cheerio library</a></li> </ul> </script>