-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscrape-it.html
61 lines (57 loc) · 1.83 KB
/
scrape-it.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<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>