# Web scrape and validation

**URL:** <https://discourse.nodered.org/t/web-scrape-and-validation/52519>\
**Category:** General\
**Created:** [21 October 2021 15:15 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519 "2021-10-21T15:15:02Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 15:15 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/1 "2021-10-21T15:15:03Z")

</div>

Hi all !.

A few months back i was working on a project were i scrap some part of this web site: [Tasmota ESP8266 Binaries](http://ota.tasmota.com/tasmota/release/) specially on the "version" element.  
Then, I validate the Tasmota version via http API and finally i compare the web version and the tasmota version to finally decide if the tasmota device is updated or not.

This is the actual flow i'm using with harcoded Tasmota information so it can be reproduced.

```auto
[
    {
        "id": "d3fe8df0.e1e6e",
        "type": "function",
        "z": "13e3e683.083059",
        "name": "compare tasmota web version with tasmota version",
        "func": "var webVersion = msg.payload.availableVersion; //get web version\nvar deviceData = msg.payload.deviceData; //get array of devices\nvar current = [];//where results will go\nvar old = [];\n//loop through each device\nfor (let i = 0; i < deviceData.length; i++) {\n let device = deviceData[i]; //get this device\n var v = device.version; //get device version\n device.version = v.split(\"(\")[0]; //split on \"(\" then take first element [0]\n device.webVersion = webVersion; //optional\n device.match = (device.version == device.webVersion); //compare device version to webVersion\n if(device.match) {\n current.push(device); //add result\n } else {\n old.push(device); //add result\n }\n}\n\nmsg.payload = {\n current: current,\n old: old\n}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1350,
        "y": 500,
        "wires": [
            [
                "88f9688.fd3c198"
            ]
        ]
    },
    {
        "id": "a7dbed0c.cc957",
        "type": "join",
        "z": "13e3e683.083059",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1010,
        "y": 500,
        "wires": [
            [
                "d3fe8df0.e1e6e",
                "88eaf502.bf6ce8"
            ]
        ]
    },
    {
        "id": "88f9688.fd3c198",
        "type": "debug",
        "z": "13e3e683.083059",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1390,
        "y": 580,
        "wires": []
    },
    {
        "id": "f16ce907.a37a88",
        "type": "change",
        "z": "13e3e683.083059",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "availableVersion",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload[6]",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 820,
        "y": 420,
        "wires": [
            [
                "a7dbed0c.cc957",
                "9b06e128.2a5fe"
            ]
        ]
    },
    {
        "id": "17b0f4da.d1640b",
        "type": "change",
        "z": "13e3e683.083059",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.{ \"name\": **.Hostname, \"ipAddress\":**.IPAddress, \"version\":**.Version }",
                "tot": "jsonata"
            },
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "deviceData",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 840,
        "y": 580,
        "wires": [
            [
                "7aa173f.df7f18c",
                "a7dbed0c.cc957"
            ]
        ]
    },
    {
        "id": "88eaf502.bf6ce8",
        "type": "debug",
        "z": "13e3e683.083059",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1130,
        "y": 580,
        "wires": []
    },
    {
        "id": "dd64a4c0.568c58",
        "type": "switch",
        "z": "13e3e683.083059",
        "name": "",
        "property": "payload[0]",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "tasmota.bin",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 670,
        "y": 420,
        "wires": [
            [
                "f16ce907.a37a88"
            ]
        ]
    },
    {
        "id": "9b06e128.2a5fe",
        "type": "debug",
        "z": "13e3e683.083059",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1010,
        "y": 360,
        "wires": []
    },
    {
        "id": "ec9d2b2e.071af8",
        "type": "join",
        "z": "13e3e683.083059",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 630,
        "y": 600,
        "wires": [
            [
                "17b0f4da.d1640b"
            ]
        ]
    },
    {
        "id": "7aa173f.df7f18c",
        "type": "debug",
        "z": "13e3e683.083059",
        "name": "",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1030,
        "y": 720,
        "wires": []
    },
    {
        "id": "24ff0fa2.0bd78",
        "type": "html",
        "z": "13e3e683.083059",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": "td",
        "ret": "html",
        "as": "single",
        "x": 550,
        "y": 420,
        "wires": [
            [
                "dd64a4c0.568c58"
            ]
        ]
    },
    {
        "id": "bb624e81.2c073",
        "type": "function",
        "z": "13e3e683.083059",
        "name": "fake device requests",
        "func": "var fake_httprequests = {\n \"192.168.1.40\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_prueba\",\"FriendlyName\":[\"luz_prueba\"],\"Topic\":\"luz_prueba\",\"ButtonTopic\":\"0\",\"Power\":0,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"tasmotas\",\"OtaUrl\":\"http://ota.tasmota.com/tasmota/release/tasmota.bin\",\"RestartReason\":\"Power On\",\"Uptime\":\"14T20:22:27\",\"StartupUTC\":\"2021-01-05T21:28:02\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":304,\"BCResetTime\":\"2020-06-12T04:30:48\",\"SaveCount\":3440,\"SaveAddress\":\"F9000\"},\"StatusFWR\":{\"Version\":\"9.2.0(tasmota)\",\"BuildDateTime\":\"2020-12-21T15:03:40\",\"Boot\":7,\"Core\":\"2_7_4_9\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"404/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8009\",\"2805C8000100060000005A00000000000000\",\"00000228\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":586,\"Free\":416,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAC787\",\"04368001\",\"000000CF\",\"010013C0\",\"C000F981\",\"00004004\",\"00001000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_prueba-6101\",\"IPAddress\":\"192.168.1.40\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"60:01:94:CA:37:D5\",\"Webserver\":2,\"WifiConfig\":4,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_CA37D5\",\"MqttUser\":\"mosquitto\",\"MqttCount\":4,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:29\",\"Local\":\"2021-01-20T18:50:29\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:29\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:29\",\"Uptime\":\"14T20:22:27\",\"UptimeSec\":1282947,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":4,\"POWER\":\"OFF\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":100,\"Signal\":-40,\"LinkCount\":4,\"Downtime\":\"0T00:09:52\"}}},\n \"192.168.1.180\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_escritorio_garaje\",\"FriendlyName\":[\"luz_escritorio_garaje\"],\"Topic\":\"luz_escritorio_garaje\",\"ButtonTopic\":\"0\",\"Power\":1,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"sonoffs\",\"OtaUrl\":\"http://thehackbox.org/tasmota/release/tasmota.bin\",\"RestartReason\":\"Software/System restart\",\"Uptime\":\"0T23:52:49\",\"StartupUTC\":\"2021-01-19T17:57:41\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":488,\"BCResetTime\":\"2020-04-15T00:57:39\",\"SaveCount\":6301,\"SaveAddress\":\"F7000\"},\"StatusFWR\":{\"Version\":\"8.5.0(tasmota)\",\"BuildDateTime\":\"2020-09-09T11:41:02\",\"Boot\":7,\"Core\":\"2_7_4_1\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"430/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8109\",\"2805C8000100060000005AFF000000000000\",\"00000200\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":595,\"Free\":408,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAE797\",\"04368001\",\"000000CD\",\"010013C0\",\"C000F981\",\"00004004\",\"00000000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_escritorio_garaje\",\"IPAddress\":\"192.168.1.180\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"DC:4F:22:F9:7D:69\",\"Webserver\":2,\"WifiConfig\":2,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_F97D69\",\"MqttUser\":\"mosquitto\",\"MqttCount\":1,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:30\",\"Local\":\"2021-01-20T18:50:30\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:30\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:30\",\"Uptime\":\"0T23:52:49\",\"UptimeSec\":85969,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":1,\"POWER\":\"ON\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":94,\"Signal\":-53,\"LinkCount\":1,\"Downtime\":\"0T00:00:06\"}}},\n}\n\nmsg.payload = fake_httprequests[msg.ip]\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 448,
        "y": 596,
        "wires": [
            [
                "ec9d2b2e.071af8"
            ]
        ]
    },
    {
        "id": "1c91208.fec35df",
        "type": "html",
        "z": "13e3e683.083059",
        "name": "",
        "property": "payload",
        "outproperty": "payload",
        "tag": "tr",
        "ret": "html",
        "as": "multi",
        "x": 430,
        "y": 420,
        "wires": [
            [
                "24ff0fa2.0bd78"
            ]
        ]
    },
    {
        "id": "f8eb8e72.964b3",
        "type": "function",
        "z": "13e3e683.083059",
        "name": "hosts",
        "func": "const tasmotas = [\"192.168.1.40\",\"192.168.1.180\"]\nconst status= \"/cm?cmnd=Status%200\"\nfor(let x=0;x<tasmotas.length;x++){\n node.send({\n url:\"http://\"+tasmotas[x]+status,\n ip: tasmotas[x]\n })\n}\nmsg.complete = true;\nmsg.payload = null;\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 270,
        "y": 596,
        "wires": [
            [
                "bb624e81.2c073"
            ]
        ]
    },
    {
        "id": "99820d79.ce827",
        "type": "http request",
        "z": "13e3e683.083059",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "http://ota.tasmota.com/tasmota/release/",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "x": 290,
        "y": 420,
        "wires": [
            [
                "1c91208.fec35df"
            ]
        ]
    },
    {
        "id": "19318c4c.785cc4",
        "type": "inject",
        "z": "13e3e683.083059",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 136,
        "y": 596,
        "wires": [
            [
                "f8eb8e72.964b3"
            ]
        ]
    },
    {
        "id": "3fc09af7.0c6176",
        "type": "inject",
        "z": "13e3e683.083059",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 420,
        "wires": [
            [
                "99820d79.ce827"
            ]
        ]
    },
    {
        "id": "5c4cede2.0021b4",
        "type": "comment",
        "z": "13e3e683.083059",
        "name": "Check Tasmota Web Version",
        "info": "",
        "x": 180,
        "y": 360,
        "wires": []
    },
    {
        "id": "8828e76c.1e13c8",
        "type": "comment",
        "z": "13e3e683.083059",
        "name": "Check Sonoff versions",
        "info": "",
        "x": 160,
        "y": 540,
        "wires": []
    }
]

```

Problems:

1. suddenly the web scrap stopped working. It cannot retrieve the td or tr element. Maybe changed on the website or something is missing.
2. The tasmota version is not working too. No information comes along.

I've been opening this issues some months ago.

> [@Web scraping issue](https://discourse.nodered.org/t/web-scraping-issue/37945/13):
>
> Hi all! I returning with another web scrapping issue... i want to obtain this result stored inside a table but i have no luck. [http://ota.tasmota.com/tasmota/release/](http://ota.tasmota.com/tasmota/release/) I have this flow. Thanks a lot in advance. [{"id":"6e1953b6.ceb55c","type":"html","z":"13e3e683.083059","name":"Check Web Site Tasmota Version","property":"","outproperty":"","tag":"\<td\>9.1.0\</td\>","ret":"text","as":"single","x":480,"y":960,"wires":[["3e9f13cb.37838c"]]},{"id":"c087b2bc.6d9e9","type":"http request",…

> [@Scraping http hosts](https://discourse.nodered.org/t/scraping-http-hosts/42261/2):
>
> So this is a continueation of [this thread](https://discourse.nodered.org/t/nodes-global-variables/39243/20) from January right? As far as I remember, all you had to do was drop the http request node in (that you had on your first/original flow) & it should of worked! (assuming the demo data you provided in Post#19 was correct) So if you put the http request node from your original flow in place of the "fake device requests" function what happens? PS: attach a debug to the ↑ http request node Show us.

> [@Nodes global variables](https://discourse.nodered.org/t/nodes-global-variables/39243/29):
>
> Was missing the e. (code was untested) var oldDevices = msg.payload.old; if(oldDevices && oldDevices.length) { msg.payload = `Found ${oldDevices.length} devices with wrong version...\n` + msg.payload.old.map(e =\> `NAME: ${e.name}, IP: ${e.ipAddress}, VER: ${e.version}`).join("\n") return msg; }

Any help will be grateful!.

Regards,

Martin.-

---

<div class="post-metadata">

**Author:** ![mdkrieg](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mdkrieg/32/39091_2.png) [@mdkrieg](https://discourse.nodered.org/u/mdkrieg)\
**Post date:** [21 October 2021 15:38 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/2 "2021-10-21T15:38:25Z")

</div>

I imported your flow and it seems to be working for me. Is there something else this should be doing?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a66fe2fdd27a7071ccdd0b340f72ef9c5453ab9.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 17:01 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/3 "2021-10-21T17:01:24Z")

</div>

> [@Marty1982](#):
>
> suddenly the web scrap stopped working. It cannot retrieve the td or tr element. Maybe changed on the website or something is missing.

I doubt it just stopped working - my guess is you have updated node-red (or are running this flow on a newer version of node-red) as it does indeed NOT work on newer node-red. What version of node-red is this?

@mdkrieg my guess is you are running node-red V1.x?

@Marty1982 the workaround is to wrap the `td` with `td` and `table`

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aae1e429087ac2c964831f037bc064a3259d6490.png)

function code...

```auto
msg.payload = `<table><tr>${msg.payload}</tr></table>`
return msg;

```

* * *

This is related: [Html node not extracting content - #11 by knolleary](https://discourse.nodered.org/t/html-node-not-extracting-content/50795/11)

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 17:23 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/4 "2021-10-21T17:23:23Z")

</div>

> [@Steve-Mcl](#):
>
> ```auto
> msg.payload = `<table><tr>${msg.payload}</tr></table>`
> return msg;
> 
> ```

Uhm ok...i use version 2.0.6 and maybe something is failing on that version.  
So, if i add that wrap id now i get this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/924934344d8e90b5ce3fdea04ea13f15ac514d8d.png)

Somehow i'm getting the Current / Old values empty....

Regards!!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 17:53 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/5 "2021-10-21T17:53:20Z")

</div>

> [@Marty1982](#):
>
> So, if i add that wrap id now i get this:
> 
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/924934344d8e90b5ce3fdea04ea13f15ac514d8d.png)
> 
> Somehow i'm getting the Current / Old values empty....

You wont get anything in "current" if you dont use **real data**. Remember [this](https://discourse.nodered.org/t/nodes-global-variables/39243/20)...

> [@Nodes global variables](https://discourse.nodered.org/t/nodes-global-variables/39243/20):
>
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc869d0c3375b64bc1343ef443601a229e2e46fe.png)
> 
> image1632×397 49.5 KB

the picture (and flow) you posted uses fake data - and that fake data has 2 entries, both with version older than "10.0.0"

so if you ...

- expand the `current` (as in array of devices with current firmware) it is empty.
- expand the `old` (as in array of devices with old firmware) it has 2 entries.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0b17beb608d42d11874c42ca09ee39d9787c3f50.png)

* * *

in simple terms - it does work.

Did you put the code in the function exactly as I wrote it?

* * *

Here is my copy (of your copy of my old flow) - it works for me on V2.x of node-red ...

```auto
[{"id":"cb08d719c8e52625","type":"function","z":"6aa5969e588704c1","name":"compare tasmota web version with tasmota version","func":"var webVersion = msg.payload.availableVersion; //get web version\nvar deviceData = msg.payload.deviceData; //get array of devices\nvar current = [];//where results will go\nvar old = [];\n//loop through each device\nfor (let i = 0; i < deviceData.length; i++) {\n let device = deviceData[i]; //get this device\n var v = device.version; //get device version\n device.version = v.split(\"(\")[0]; //split on \"(\" then take first element [0]\n device.webVersion = webVersion; //optional\n device.match = (device.version == device.webVersion); //compare device version to webVersion\n if(device.match) {\n current.push(device); //add result\n } else {\n old.push(device); //add result\n }\n}\n\nmsg.payload = {\n current: current,\n old: old\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1390,"y":620,"wires":[["54df8002de28aa60"]]},{"id":"9de9faa568f00746","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1050,"y":620,"wires":[["cb08d719c8e52625"]]},{"id":"54df8002de28aa60","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":700,"wires":[]},{"id":"aee89e22179a36d1","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"availableVersion","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":540,"wires":[["9de9faa568f00746","0a9fb2c70b626be9"]]},{"id":"e4c34c55784023c7","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.{ \"name\": **.Hostname, \"ipAddress\":**.IPAddress, \"version\":**.Version }","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"deviceData","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":700,"wires":[["9de9faa568f00746"]]},{"id":"9de27f4d50bd963b","type":"switch","z":"6aa5969e588704c1","name":"","property":"payload[0]","propertyType":"msg","rules":[{"t":"cont","v":"tasmota.bin","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":770,"y":540,"wires":[["aee89e22179a36d1"]]},{"id":"0a9fb2c70b626be9","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":480,"wires":[]},{"id":"49198b2262aa2915","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":670,"y":720,"wires":[["e4c34c55784023c7"]]},{"id":"ca899b140e01ab19","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":650,"y":540,"wires":[["9de27f4d50bd963b"]]},{"id":"b10bbae077052636","type":"function","z":"6aa5969e588704c1","name":"fake device requests","func":"var fake_httprequests = {\n \"192.168.1.40\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_prueba\",\"FriendlyName\":[\"luz_prueba\"],\"Topic\":\"luz_prueba\",\"ButtonTopic\":\"0\",\"Power\":0,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"tasmotas\",\"OtaUrl\":\"http://ota.tasmota.com/tasmota/release/tasmota.bin\",\"RestartReason\":\"Power On\",\"Uptime\":\"14T20:22:27\",\"StartupUTC\":\"2021-01-05T21:28:02\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":304,\"BCResetTime\":\"2020-06-12T04:30:48\",\"SaveCount\":3440,\"SaveAddress\":\"F9000\"},\"StatusFWR\":{\"Version\":\"9.2.0(tasmota)\",\"BuildDateTime\":\"2020-12-21T15:03:40\",\"Boot\":7,\"Core\":\"2_7_4_9\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"404/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8009\",\"2805C8000100060000005A00000000000000\",\"00000228\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":586,\"Free\":416,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAC787\",\"04368001\",\"000000CF\",\"010013C0\",\"C000F981\",\"00004004\",\"00001000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_prueba-6101\",\"IPAddress\":\"192.168.1.40\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"60:01:94:CA:37:D5\",\"Webserver\":2,\"WifiConfig\":4,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_CA37D5\",\"MqttUser\":\"mosquitto\",\"MqttCount\":4,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:29\",\"Local\":\"2021-01-20T18:50:29\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:29\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:29\",\"Uptime\":\"14T20:22:27\",\"UptimeSec\":1282947,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":4,\"POWER\":\"OFF\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":100,\"Signal\":-40,\"LinkCount\":4,\"Downtime\":\"0T00:09:52\"}}},\n \"192.168.1.180\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_escritorio_garaje\",\"FriendlyName\":[\"luz_escritorio_garaje\"],\"Topic\":\"luz_escritorio_garaje\",\"ButtonTopic\":\"0\",\"Power\":1,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"sonoffs\",\"OtaUrl\":\"http://thehackbox.org/tasmota/release/tasmota.bin\",\"RestartReason\":\"Software/System restart\",\"Uptime\":\"0T23:52:49\",\"StartupUTC\":\"2021-01-19T17:57:41\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":488,\"BCResetTime\":\"2020-04-15T00:57:39\",\"SaveCount\":6301,\"SaveAddress\":\"F7000\"},\"StatusFWR\":{\"Version\":\"8.5.0(tasmota)\",\"BuildDateTime\":\"2020-09-09T11:41:02\",\"Boot\":7,\"Core\":\"2_7_4_1\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"430/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8109\",\"2805C8000100060000005AFF000000000000\",\"00000200\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":595,\"Free\":408,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAE797\",\"04368001\",\"000000CD\",\"010013C0\",\"C000F981\",\"00004004\",\"00000000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_escritorio_garaje\",\"IPAddress\":\"192.168.1.180\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"DC:4F:22:F9:7D:69\",\"Webserver\":2,\"WifiConfig\":2,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_F97D69\",\"MqttUser\":\"mosquitto\",\"MqttCount\":1,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:30\",\"Local\":\"2021-01-20T18:50:30\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:30\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:30\",\"Uptime\":\"0T23:52:49\",\"UptimeSec\":85969,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":1,\"POWER\":\"ON\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":94,\"Signal\":-53,\"LinkCount\":1,\"Downtime\":\"0T00:00:06\"}}},\n}\n\nmsg.payload = fake_httprequests[msg.ip]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":488,"y":716,"wires":[["49198b2262aa2915"]]},{"id":"32ee64d6bec8b999","type":"function","z":"6aa5969e588704c1","name":"hosts","func":"const tasmotas = [\"192.168.1.40\",\"192.168.1.180\"]\nconst status= \"/cm?cmnd=Status%200\"\nfor(let x=0;x<tasmotas.length;x++){\n node.send({\n url:\"http://\"+tasmotas[x]+status,\n ip: tasmotas[x]\n })\n}\nmsg.complete = true;\nmsg.payload = null;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":716,"wires":[["b10bbae077052636"]]},{"id":"13ab16a9c60a6021","type":"http request","z":"6aa5969e588704c1","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://ota.tasmota.com/tasmota/release/","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":330,"y":540,"wires":[["be7ca6173afce7a4"]]},{"id":"883cf43c743cfaee","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":176,"y":716,"wires":[["32ee64d6bec8b999"]]},{"id":"20a42053f6c5e4c0","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":540,"wires":[["13ab16a9c60a6021"]]},{"id":"0a0104963feb4127","type":"comment","z":"6aa5969e588704c1","name":"Check Tasmota Web Version","info":"","x":220,"y":480,"wires":[]},{"id":"8d8b1b21c0ca64af","type":"comment","z":"6aa5969e588704c1","name":"Check Sonoff versions","info":"","x":200,"y":660,"wires":[]},{"id":"be7ca6173afce7a4","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"tr","ret":"html","as":"multi","x":470,"y":540,"wires":[["ddfcdc4acd7d1a0e"]]},{"id":"ddfcdc4acd7d1a0e","type":"function","z":"6aa5969e588704c1","name":"wrap td","func":"msg.payload = `<table><tr>${msg.payload}</tr></table>`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":500,"wires":[["ca899b140e01ab19"]]}]

```

* * *

EDIT

Did you operate both inject buttons?

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 18:39 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/6 "2021-10-21T18:39:43Z")

</div>

> [@Steve-Mcl](#):
>
> ```auto
> [{"id":"cb08d719c8e52625","type":"function","z":"6aa5969e588704c1","name":"compare tasmota web version with tasmota version","func":"var webVersion = msg.payload.availableVersion; //get web version\nvar deviceData = msg.payload.deviceData; //get array of devices\nvar current = [];//where results will go\nvar old = [];\n//loop through each device\nfor (let i = 0; i < deviceData.length; i++) {\n let device = deviceData[i]; //get this device\n var v = device.version; //get device version\n device.version = v.split(\"(\")[0]; //split on \"(\" then take first element [0]\n device.webVersion = webVersion; //optional\n device.match = (device.version == device.webVersion); //compare device version to webVersion\n if(device.match) {\n current.push(device); //add result\n } else {\n old.push(device); //add result\n }\n}\n\nmsg.payload = {\n current: current,\n old: old\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1390,"y":620,"wires":[["54df8002de28aa60"]]},{"id":"9de9faa568f00746","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1050,"y":620,"wires":[["cb08d719c8e52625"]]},{"id":"54df8002de28aa60","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":700,"wires":[]},{"id":"aee89e22179a36d1","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"availableVersion","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":540,"wires":[["9de9faa568f00746","0a9fb2c70b626be9"]]},{"id":"e4c34c55784023c7","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.{ \"name\": **.Hostname, \"ipAddress\":**.IPAddress, \"version\":**.Version }","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"deviceData","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":700,"wires":[["9de9faa568f00746"]]},{"id":"9de27f4d50bd963b","type":"switch","z":"6aa5969e588704c1","name":"","property":"payload[0]","propertyType":"msg","rules":[{"t":"cont","v":"tasmota.bin","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":770,"y":540,"wires":[["aee89e22179a36d1"]]},{"id":"0a9fb2c70b626be9","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":480,"wires":[]},{"id":"49198b2262aa2915","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":670,"y":720,"wires":[["e4c34c55784023c7"]]},{"id":"ca899b140e01ab19","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":650,"y":540,"wires":[["9de27f4d50bd963b"]]},{"id":"b10bbae077052636","type":"function","z":"6aa5969e588704c1","name":"fake device requests","func":"var fake_httprequests = {\n \"192.168.1.40\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_prueba\",\"FriendlyName\":[\"luz_prueba\"],\"Topic\":\"luz_prueba\",\"ButtonTopic\":\"0\",\"Power\":0,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"tasmotas\",\"OtaUrl\":\"http://ota.tasmota.com/tasmota/release/tasmota.bin\",\"RestartReason\":\"Power On\",\"Uptime\":\"14T20:22:27\",\"StartupUTC\":\"2021-01-05T21:28:02\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":304,\"BCResetTime\":\"2020-06-12T04:30:48\",\"SaveCount\":3440,\"SaveAddress\":\"F9000\"},\"StatusFWR\":{\"Version\":\"9.2.0(tasmota)\",\"BuildDateTime\":\"2020-12-21T15:03:40\",\"Boot\":7,\"Core\":\"2_7_4_9\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"404/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8009\",\"2805C8000100060000005A00000000000000\",\"00000228\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":586,\"Free\":416,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAC787\",\"04368001\",\"000000CF\",\"010013C0\",\"C000F981\",\"00004004\",\"00001000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_prueba-6101\",\"IPAddress\":\"192.168.1.40\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"60:01:94:CA:37:D5\",\"Webserver\":2,\"WifiConfig\":4,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_CA37D5\",\"MqttUser\":\"mosquitto\",\"MqttCount\":4,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:29\",\"Local\":\"2021-01-20T18:50:29\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:29\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:29\",\"Uptime\":\"14T20:22:27\",\"UptimeSec\":1282947,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":4,\"POWER\":\"OFF\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":100,\"Signal\":-40,\"LinkCount\":4,\"Downtime\":\"0T00:09:52\"}}},\n \"192.168.1.180\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_escritorio_garaje\",\"FriendlyName\":[\"luz_escritorio_garaje\"],\"Topic\":\"luz_escritorio_garaje\",\"ButtonTopic\":\"0\",\"Power\":1,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"sonoffs\",\"OtaUrl\":\"http://thehackbox.org/tasmota/release/tasmota.bin\",\"RestartReason\":\"Software/System restart\",\"Uptime\":\"0T23:52:49\",\"StartupUTC\":\"2021-01-19T17:57:41\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":488,\"BCResetTime\":\"2020-04-15T00:57:39\",\"SaveCount\":6301,\"SaveAddress\":\"F7000\"},\"StatusFWR\":{\"Version\":\"8.5.0(tasmota)\",\"BuildDateTime\":\"2020-09-09T11:41:02\",\"Boot\":7,\"Core\":\"2_7_4_1\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"430/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8109\",\"2805C8000100060000005AFF000000000000\",\"00000200\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":595,\"Free\":408,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAE797\",\"04368001\",\"000000CD\",\"010013C0\",\"C000F981\",\"00004004\",\"00000000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_escritorio_garaje\",\"IPAddress\":\"192.168.1.180\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"DC:4F:22:F9:7D:69\",\"Webserver\":2,\"WifiConfig\":2,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_F97D69\",\"MqttUser\":\"mosquitto\",\"MqttCount\":1,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:30\",\"Local\":\"2021-01-20T18:50:30\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:30\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:30\",\"Uptime\":\"0T23:52:49\",\"UptimeSec\":85969,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":1,\"POWER\":\"ON\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":94,\"Signal\":-53,\"LinkCount\":1,\"Downtime\":\"0T00:00:06\"}}},\n}\n\nmsg.payload = fake_httprequests[msg.ip]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":488,"y":716,"wires":[["49198b2262aa2915"]]},{"id":"32ee64d6bec8b999","type":"function","z":"6aa5969e588704c1","name":"hosts","func":"const tasmotas = [\"192.168.1.40\",\"192.168.1.180\"]\nconst status= \"/cm?cmnd=Status%200\"\nfor(let x=0;x<tasmotas.length;x++){\n node.send({\n url:\"http://\"+tasmotas[x]+status,\n ip: tasmotas[x]\n })\n}\nmsg.complete = true;\nmsg.payload = null;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":716,"wires":[["b10bbae077052636"]]},{"id":"13ab16a9c60a6021","type":"http request","z":"6aa5969e588704c1","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://ota.tasmota.com/tasmota/release/","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":330,"y":540,"wires":[["be7ca6173afce7a4"]]},{"id":"883cf43c743cfaee","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":176,"y":716,"wires":[["32ee64d6bec8b999"]]},{"id":"20a42053f6c5e4c0","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":540,"wires":[["13ab16a9c60a6021"]]},{"id":"0a0104963feb4127","type":"comment","z":"6aa5969e588704c1","name":"Check Tasmota Web Version","info":"","x":220,"y":480,"wires":[]},{"id":"8d8b1b21c0ca64af","type":"comment","z":"6aa5969e588704c1","name":"Check Sonoff versions","info":"","x":200,"y":660,"wires":[]},{"id":"be7ca6173afce7a4","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"tr","ret":"html","as":"multi","x":470,"y":540,"wires":[["ddfcdc4acd7d1a0e"]]},{"id":"ddfcdc4acd7d1a0e","type":"function","z":"6aa5969e588704c1","name":"wrap td","func":"msg.payload = `<table><tr>${msg.payload}</tr></table>`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":500,"wires":[["ca899b140e01ab19"]]}]
> 
> ```

Ok.... thanks for the answer!

No i have this error.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e6d39cef9fe8c76a5471b2d3c7846472b3231c5.png)

I've modified the function "hosts" where it hold the real host ip but the http cannot be complete.

Regards!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 19:02 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/7 "2021-10-21T19:02:42Z")

</div>

Has this ever worked?

The `hosts` function sent an msg with `msg.complete` (empty url) to trigger the join node to release the data.

The error you are seeing is because `msg.url` is not set for that last message.

So I modified the hosts function to set `msg.complete` on the last host msg (instead of sending an extra msg with empty url)

try this...

```auto
[{"id":"cb08d719c8e52625","type":"function","z":"6aa5969e588704c1","name":"compare tasmota web version with tasmota version","func":"var webVersion = msg.payload.availableVersion; //get web version\nvar deviceData = msg.payload.deviceData; //get array of devices\nvar current = [];//where results will go\nvar old = [];\n//loop through each device\nfor (let i = 0; i < deviceData.length; i++) {\n let device = deviceData[i]; //get this device\n var v = device.version; //get device version\n device.version = v.split(\"(\")[0]; //split on \"(\" then take first element [0]\n device.webVersion = webVersion; //optional\n device.match = (device.version == device.webVersion); //compare device version to webVersion\n if(device.match) {\n current.push(device); //add result\n } else {\n old.push(device); //add result\n }\n}\n\nmsg.payload = {\n current: current,\n old: old\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1390,"y":620,"wires":[["54df8002de28aa60"]]},{"id":"9de9faa568f00746","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1050,"y":620,"wires":[["cb08d719c8e52625"]]},{"id":"54df8002de28aa60","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1430,"y":700,"wires":[]},{"id":"aee89e22179a36d1","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"availableVersion","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload[6]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":920,"y":540,"wires":[["9de9faa568f00746","0a9fb2c70b626be9"]]},{"id":"e4c34c55784023c7","type":"change","z":"6aa5969e588704c1","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.{ \"name\": **.Hostname, \"ipAddress\":**.IPAddress, \"version\":**.Version }","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"deviceData","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":700,"wires":[["9de9faa568f00746","4cf68f0ae2653ef1"]]},{"id":"9de27f4d50bd963b","type":"switch","z":"6aa5969e588704c1","name":"","property":"payload[0]","propertyType":"msg","rules":[{"t":"cont","v":"tasmota.bin","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":770,"y":540,"wires":[["aee89e22179a36d1"]]},{"id":"0a9fb2c70b626be9","type":"debug","z":"6aa5969e588704c1","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":480,"wires":[]},{"id":"49198b2262aa2915","type":"join","z":"6aa5969e588704c1","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":710,"y":720,"wires":[["e4c34c55784023c7"]]},{"id":"ca899b140e01ab19","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":650,"y":540,"wires":[["9de27f4d50bd963b"]]},{"id":"b10bbae077052636","type":"function","z":"6aa5969e588704c1","name":"fake device requests","func":"var fake_httprequests = {\n \"192.168.1.40\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_prueba\",\"FriendlyName\":[\"luz_prueba\"],\"Topic\":\"luz_prueba\",\"ButtonTopic\":\"0\",\"Power\":0,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"tasmotas\",\"OtaUrl\":\"http://ota.tasmota.com/tasmota/release/tasmota.bin\",\"RestartReason\":\"Power On\",\"Uptime\":\"14T20:22:27\",\"StartupUTC\":\"2021-01-05T21:28:02\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":304,\"BCResetTime\":\"2020-06-12T04:30:48\",\"SaveCount\":3440,\"SaveAddress\":\"F9000\"},\"StatusFWR\":{\"Version\":\"9.2.0(tasmota)\",\"BuildDateTime\":\"2020-12-21T15:03:40\",\"Boot\":7,\"Core\":\"2_7_4_9\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"404/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8009\",\"2805C8000100060000005A00000000000000\",\"00000228\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":586,\"Free\":416,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAC787\",\"04368001\",\"000000CF\",\"010013C0\",\"C000F981\",\"00004004\",\"00001000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37,45\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_prueba-6101\",\"IPAddress\":\"192.168.1.40\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"60:01:94:CA:37:D5\",\"Webserver\":2,\"WifiConfig\":4,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_CA37D5\",\"MqttUser\":\"mosquitto\",\"MqttCount\":4,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:29\",\"Local\":\"2021-01-20T18:50:29\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:29\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:29\",\"Uptime\":\"14T20:22:27\",\"UptimeSec\":1282947,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":4,\"POWER\":\"OFF\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":100,\"Signal\":-40,\"LinkCount\":4,\"Downtime\":\"0T00:09:52\"}}},\n \"192.168.1.180\": {\"Status\":{\"Module\":1,\"DeviceName\":\"luz_escritorio_garaje\",\"FriendlyName\":[\"luz_escritorio_garaje\"],\"Topic\":\"luz_escritorio_garaje\",\"ButtonTopic\":\"0\",\"Power\":1,\"PowerOnState\":3,\"LedState\":1,\"LedMask\":\"FFFF\",\"SaveData\":1,\"SaveState\":1,\"SwitchTopic\":\"0\",\"SwitchMode\":[0,0,0,0,0,0,0,0],\"ButtonRetain\":0,\"SwitchRetain\":0,\"SensorRetain\":0,\"PowerRetain\":0},\"StatusPRM\":{\"Baudrate\":115200,\"SerialConfig\":\"8N1\",\"GroupTopic\":\"sonoffs\",\"OtaUrl\":\"http://thehackbox.org/tasmota/release/tasmota.bin\",\"RestartReason\":\"Software/System restart\",\"Uptime\":\"0T23:52:49\",\"StartupUTC\":\"2021-01-19T17:57:41\",\"Sleep\":50,\"CfgHolder\":4617,\"BootCount\":488,\"BCResetTime\":\"2020-04-15T00:57:39\",\"SaveCount\":6301,\"SaveAddress\":\"F7000\"},\"StatusFWR\":{\"Version\":\"8.5.0(tasmota)\",\"BuildDateTime\":\"2020-09-09T11:41:02\",\"Boot\":7,\"Core\":\"2_7_4_1\",\"SDK\":\"2.2.2-dev(38a443e)\",\"CpuFrequency\":80,\"Hardware\":\"ESP8285\",\"CR\":\"430/699\"},\"StatusLOG\":{\"SerialLog\":2,\"WebLog\":2,\"MqttLog\":0,\"SysLog\":0,\"LogHost\":\"\",\"LogPort\":514,\"SSId\":[\"BellVille2.4ghz\",\"\"],\"TelePeriod\":300,\"Resolution\":\"558180C0\",\"SetOption\":[\"002A8109\",\"2805C8000100060000005AFF000000000000\",\"00000200\",\"00006000\",\"00000000\"]},\"StatusMEM\":{\"ProgramSize\":595,\"Free\":408,\"Heap\":23,\"ProgramFlashSize\":1024,\"FlashSize\":1024,\"FlashChipId\":\"144051\",\"FlashFrequency\":40,\"FlashMode\":3,\"Features\":[\"00000809\",\"8FDAE797\",\"04368001\",\"000000CD\",\"010013C0\",\"C000F981\",\"00004004\",\"00000000\"],\"Drivers\":\"1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,27,29,30,35,37\",\"Sensors\":\"1,2,3,4,5,6\"},\"StatusNET\":{\"Hostname\":\"luz_escritorio_garaje\",\"IPAddress\":\"192.168.1.180\",\"Gateway\":\"192.168.1.1\",\"Subnetmask\":\"255.255.255.0\",\"DNSServer\":\"192.168.1.1\",\"Mac\":\"DC:4F:22:F9:7D:69\",\"Webserver\":2,\"WifiConfig\":2,\"WifiPower\":17},\"StatusMQT\":{\"MqttHost\":\"192.168.1.8\",\"MqttPort\":1883,\"MqttClientMask\":\"DVES_%06X\",\"MqttClient\":\"DVES_F97D69\",\"MqttUser\":\"mosquitto\",\"MqttCount\":1,\"MAX_PACKET_SIZE\":1200,\"KEEPALIVE\":30},\"StatusTIM\":{\"UTC\":\"2021-01-20T17:50:30\",\"Local\":\"2021-01-20T18:50:30\",\"StartDST\":\"2021-03-28T02:00:00\",\"EndDST\":\"2021-10-31T03:00:00\",\"Timezone\":\"+01:00\",\"Sunrise\":\"08:34\",\"Sunset\":\"17:28\"},\"StatusSNS\":{\"Time\":\"2021-01-20T18:50:30\"},\"StatusSTS\":{\"Time\":\"2021-01-20T18:50:30\",\"Uptime\":\"0T23:52:49\",\"UptimeSec\":85969,\"Heap\":23,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":1,\"POWER\":\"ON\",\"Wifi\":{\"AP\":1,\"SSId\":\"BellVille2.4ghz\",\"BSSId\":\"C8:D7:19:52:9D:27\",\"Channel\":10,\"RSSI\":94,\"Signal\":-53,\"LinkCount\":1,\"Downtime\":\"0T00:00:06\"}}},\n}\n\nmsg.payload = fake_httprequests[msg.ip]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":720,"wires":[["49198b2262aa2915"]]},{"id":"32ee64d6bec8b999","type":"function","z":"6aa5969e588704c1","name":"hosts","func":"const tasmotas = [\"192.168.1.40\",\"192.168.1.180\"]\nconst status= \"/cm?cmnd=Status%200\"\nconst messages = [];\nfor(let x=0;x<tasmotas.length;x++){\n messages.push({\n url:\"http://\"+tasmotas[x]+status,\n ip: tasmotas[x]\n })\n}\n\nmessages[messages.length - 1].complete = true;\n\nreturn [messages]\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":720,"wires":[["b10bbae077052636"]]},{"id":"13ab16a9c60a6021","type":"http request","z":"6aa5969e588704c1","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://ota.tasmota.com/tasmota/release/","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":330,"y":540,"wires":[["be7ca6173afce7a4"]]},{"id":"883cf43c743cfaee","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":720,"wires":[["32ee64d6bec8b999"]]},{"id":"20a42053f6c5e4c0","type":"inject","z":"6aa5969e588704c1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":540,"wires":[["13ab16a9c60a6021"]]},{"id":"0a0104963feb4127","type":"comment","z":"6aa5969e588704c1","name":"Check Tasmota Web Version","info":"","x":220,"y":480,"wires":[]},{"id":"8d8b1b21c0ca64af","type":"comment","z":"6aa5969e588704c1","name":"Check Sonoff versions","info":"","x":200,"y":660,"wires":[]},{"id":"be7ca6173afce7a4","type":"html","z":"6aa5969e588704c1","name":"","property":"payload","outproperty":"payload","tag":"tr","ret":"html","as":"multi","x":470,"y":540,"wires":[["ddfcdc4acd7d1a0e"]]},{"id":"ddfcdc4acd7d1a0e","type":"function","z":"6aa5969e588704c1","name":"wrap td","func":"msg.payload = `<table><tr>${msg.payload}</tr></table>`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":500,"wires":[["ca899b140e01ab19"]]},{"id":"4cf68f0ae2653ef1","type":"debug","z":"6aa5969e588704c1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1084,"y":743,"wires":[]},{"id":"b421a724115e756c","type":"comment","z":"6aa5969e588704c1","name":"replace fake node with http request","info":"","x":520,"y":820,"wires":[]},{"id":"9122db7e71062b8d","type":"http request","z":"6aa5969e588704c1","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{"user":"","password":""},"x":500,"y":840,"wires":[[]]}]

```

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 19:07 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/8 "2021-10-21T19:07:14Z")

</div>

Ok...now this is what i have replacing the http request node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee15f558af0b216a6d42f70640d3f2730e2648d1.png)

Before it worked fine, very strange it stopped working suddenly.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 19:08 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/9 "2021-10-21T19:08:55Z")

</div>

Did you update the host IP addresses in the `host` function node?

put debug nodes (set to show complete message) after EVERY node and see what is happening & where it breaks down.

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 19:18 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/10 "2021-10-21T19:18:50Z")

</div>

Ok this are the debugs. I've already updated the hosts ip in function node before. In fact i have only one host now 192.168.1.4

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49f87e558ed83d20bbec278ed6c8aaeb892b88fa.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 19:24 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/11 "2021-10-21T19:24:16Z")

</div>

> [@Marty1982](#):
>
> I've already updated the hosts ip in function node before

Yes, but as i explained before...

> [@Steve-Mcl](#):
>
> So I modified the hosts function to set `msg.complete` on the last host msg (instead of sending an extra msg with empty url)

Did you use the new hosts function code I provided?

show me whats in your hosts function.

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 19:42 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/12 "2021-10-21T19:42:01Z")

</div>

This is my host node with the information i have right now.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/450e2df9fbadc0dacf9d60ee3a89ab9694dae3f2.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 19:48 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/13 "2021-10-21T19:48:47Z")

</div>

set the HTP Request like this...

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f281c6e5b49f0a20a97c686fb21021155296b43f.png)

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 19:56 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/14 "2021-10-21T19:56:44Z")

</div>

OK, done!.

Now at the end of the flow i have an empty data.  
But previously i can get both information, webversion and device version.  
So maybe there is something wrong in the final function.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/775141662a228bfa6f73867953bf8c04a83a747e.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 October 2021 20:12 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/15 "2021-10-21T20:12:19Z")

</div>

deviceData is an array in the code I sent you - you have an object.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26b6e68f9a56b92d070ddc94d6c27882bbb91d9c.png)

* * *

It looks like this is due to there only being 1 item in your hosts function. The join is outputing the single object instead of an array of 1 item - a new curve ball for me! I thought it would still output an array!

No matter, we can work around this.

Edit the last function node to this...

```auto
var webVersion = msg.payload.availableVersion; //get web version
var deviceData = msg.payload.deviceData; //get array of devices

if (Array.isArray(deviceData) == false) {
    deviceData = [deviceData];
}

var current = [];//where results will go
var old = [];
//loop through each device
for (let i = 0; i < deviceData.length; i++) {
    let device = deviceData[i]; //get this device
    var v = device.version; //get device version
    device.version = v.split("(")[0]; //split on "(" then take first element [0]
    device.webVersion = webVersion; //optional
    device.match = (device.version == device.webVersion); //compare device version to webVersion
    if(device.match) {
        current.push(device); //add result
    } else {
        old.push(device); //add result
    }
}

msg.payload = {
    current: current,
    old: old
}
return msg;

```

---

<div class="post-metadata">

**Author:** ![Marty1982](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marty1982/32/20162_2.png) [@Marty1982](https://discourse.nodered.org/u/Marty1982)\
**Post date:** [21 October 2021 20:34 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/16 "2021-10-21T20:34:45Z")

</div>

Curve ball! jajaja, because of this projects with trial and fail comes the curved ball.

Now it seems to brings the right data!.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/6/a63a18d3b55843d92664b487c845d46bc4496ee1.png)

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 December 2021 20:35 UTC](https://discourse.nodered.org/t/web-scrape-and-validation/52519/17 "2021-12-20T20:35:22Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
