Http request keeps requesting, kills Node-RED server

Hello, my http request keeps the status "requesting" and will eventually kill the Node-RED server on my Raspberry Pi.

So far I built two other http request flows, to get data from websites. Those are running very happily for some time now. This one is behaving differently. Why, and how to solve it?

This is the flow:

[{"id":"70d8a976.18205","type":"tab","label":"Afval","disabled":false,"info":""},{"id":"2dd57aa5.ad55a6","type":"http request","z":"70d8a976.18205","name":"RMN","method":"GET","ret":"txt","paytoqs":false,"url":"","tls":"","persist":false,"proxy":"","authType":"","x":530,"y":100,"wires":[["a28c2875.4c7198","edd1122.95980f"]]},{"id":"1d5b29b4.86108e","type":"function","z":"70d8a976.18205","name":"Specify url","func":"const query = \"https://inzamelschema.rmn.nl/adres/3704DV:127\";\n// var lastdate = global.get(\"lastRmnDate\") || \"\";\n// var today = new Date();\n\n// var ds = today.toISOString();\n// var date1 = ds.substr(0,10);\n\n// if (date1 == lastdate) {\n//     // No need to fetch the url again\n//     msg.needed = false;\n// }\n// else {\n//     // Yes, we need to get the RMN calendar!\n//     msg.needed = true;\n//     msg.today = date1;\n// }\n\nmsg.url = query;\n\n// Experiments to get it going\nmsg.payload = \"\";\nmsg.rejectUnauthorized = false;\n\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":100,"wires":[["2dd57aa5.ad55a6"]]},{"id":"15d0f143.55217f","type":"inject","z":"70d8a976.18205","name":"GetRMN","topic":"","payload":"GetRMN","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"","x":120,"y":100,"wires":[["1d5b29b4.86108e"]]},{"id":"fb4f548b.4491a","type":"comment","z":"70d8a976.18205","name":"Ophalen Afvalkalender RMN","info":"","x":160,"y":60,"wires":[]},{"id":"edd1122.95980f","type":"debug","z":"70d8a976.18205","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":770,"y":160,"wires":[]},{"id":"a28c2875.4c7198","type":"function","z":"70d8a976.18205","name":"Get table","func":"const patt0 = /\\r?\\n|\\r/g;                 // to remove newlines\nconst patt1 = /<h1>Wanneer(.+?)<footer/;   // find table\nconst patt2 = /<li>(.+?)<\\/li/g;           // find rows\nconst patt3 = /(<img\\ssrc=\"[^>]*\\/>)/;     // find icons\nconst patt4 = /<i\\sclass=\"date\">([^<]*)</; // find dates\nconst patt5 = /<i>([^<]*)</                // find waste\nvar re1, re2, re3, re4, re5;\nvar dtm = msg.today;\nvar txt = \"\";\nvar i, j;\nvar all_ok = true;\nvar row = [];\n\nmsg.rmnStatus = false;\n\nvar html = msg.payload;\nhtml = html.replace(patt0, \"\");\n\nre1 = patt1.exec(html);\n\nif (re1) {\n    txt = re1[1].toString();\n\n    // while re2: find rows\n    do {\n        re2 = patt2.exec(txt);\n        if (re2) {\n            row.push(re2[1].toString());\n        }\n    } while (re2)\n}\n\nfor (i = 0; i < row.length; i++) {\n    var col = [];\n    var usable = false;\n\n    txt = row[i];\n    // while re3 or re4: find columns\n    do {\n        re3 = patt3.exec(txt);\n        if (re3) {\n            col.push(re3[1]);\n            usable = true;\n        }\n    } while (re3)\n    do {\n        re4 = patt4.exec(txt);\n        if (re4) {\n            col.push(re4[1]);\n            usable = true;\n        }\n    } while (re4)\n    do {\n        re5 = patt5.exec(txt);\n        if (re5) {\n            col.push(re5[1]);\n            usable = true;\n        }\n    } while (re5)\n    \n    if(usable) {\n\n    }\n}\n\nmsg.payload = row;\nmsg.rows = row;\n\nreturn msg;","outputs":1,"noerr":0,"x":760,"y":100,"wires":[[]]}]

The homepage of the local waste service can be retrieved without problems. Also the page with the form to enter postal code and home number: https://inzamelschema.rmn.nl/
Entering 3704DV and 127 will lead to url https://inzamelschema.rmn.nl/adres/3704DV:127
This url won't retrieve any response. Just putting it in several browsers without visiting the website or form before will give the information straightaway.

Running v1.04 on node.js v12.16.1, Raspberry PI with Ubuntu 18.04 LTS

Any thoughts? Thanks!

Running Node-RED on my Windows laptop too, now. Flow also crashes the server.

Error report: Allocation failed - JavaScript heap out of memory


{
  "header": {
    "reportVersion": 2,
    "event": "Allocation failed - JavaScript heap out of memory",
    "trigger": "FatalError",
    "filename": "report.20200502.122604.1496.0.001.json",
    "dumpEventTime": "2020-05-02T12:26:04Z",
    "dumpEventTimeStamp": "1588415164347",
    "processId": 1496,
    "threadId": null,
    "cwd": "C:\\Users\\Zzz",
    "commandLine": [
      "node",
      "C:\\Users\\Zzz\\AppData\\Roaming\\npm\\\\node_modules\\node-red\\red.js"
    ],
    "nodejsVersion": "v12.16.3",
    "wordSize": 64,
    "arch": "x64",
    "platform": "win32",
    "componentVersions": {
      "node": "12.16.3",
      "v8": "7.8.279.23-node.35",
      "uv": "1.34.2",
      "zlib": "1.2.11",
      "brotli": "1.0.7",
      "ares": "1.16.0",
      "modules": "72",
      "nghttp2": "1.40.0",
      "napi": "5",
      "llhttp": "2.0.4",
      "http_parser": "2.9.3",
      "openssl": "1.1.1g",
      "cldr": "36.0",
      "icu": "65.1",
      "tz": "2019c",
      "unicode": "12.1"
    },
    "release": {
      "name": "node",
      "lts": "Erbium",
      "headersUrl": "https://nodejs.org/download/release/v12.16.3/node-v12.16.3-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v12.16.3/node-v12.16.3.tar.gz",
      "libUrl": "https://nodejs.org/download/release/v12.16.3/win-x64/node.lib"
    },
    "osName": "Windows_NT",
    "osRelease": "10.0.18363",
    "osVersion": "Windows 10 Pro",
    "osMachine": "x86_64",
    "cpus": [
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 71718,
        "nice": 0,
        "sys": 48593,
        "idle": 281062,
        "irq": 7968
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 31015,
        "nice": 0,
        "sys": 27750,
        "idle": 342109,
        "irq": 406
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 64062,
        "nice": 0,
        "sys": 38890,
        "idle": 297921,
        "irq": 359
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 42453,
        "nice": 0,
        "sys": 28078,
        "idle": 330343,
        "irq": 281
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 72687,
        "nice": 0,
        "sys": 45984,
        "idle": 282203,
        "irq": 718
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 71640,
        "nice": 0,
        "sys": 32046,
        "idle": 297156,
        "irq": 875
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 59796,
        "nice": 0,
        "sys": 39203,
        "idle": 301843,
        "irq": 546
      },
      {
        "model": "Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz",
        "speed": 1992,
        "user": 77562,
        "nice": 0,
        "sys": 31265,
        "idle": 292015,
        "irq": 281
      }
    ],
    "networkInterfaces": [
      {
        "name": "WiFi",
        "internal": false,
        "mac": "xx:xx:xx:xx:xx:xx",
        "address": "192.168.0.122",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "Loopback Pseudo-Interface 1",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "::1",
        "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
        "family": "IPv6",
        "scopeid": 0
      },
      {
        "name": "Loopback Pseudo-Interface 1",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "127.0.0.1",
        "netmask": "255.0.0.0",
        "family": "IPv4"
      }
    ],
    "host": "LAPTOP-XXXXXXXX"
  },
  "javascriptStack": {
    "message": "No stack.",
    "stack": [
      "Unavailable."
    ]
  },
  "nativeStack": [
    {
      "pc": "0x00007ff782ff2449",
      "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+11577"
    },
    {
      "pc": "0x00007ff782ff69a9",
      "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+29337"
    },
    {
      "pc": "0x00007ff782ff5828",
      "symbol": "std::basic_ostream<char,std::char_traits<char> >::operator<<+24856"
    },
    {
      "pc": "0x00007ff78312d8c2",
      "symbol": "v8::base::CPU::has_sse+68658"
    },
    {
      "pc": "0x00007ff783949bbe",
      "symbol": "v8::Isolate::ReportExternalAllocationLimitReached+94"
    },
    {
      "pc": "0x00007ff783931c91",
      "symbol": "v8::SharedArrayBuffer::Externalize+833"
    },
    {
      "pc": "0x00007ff7837fe1ec",
      "symbol": "v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436"
    },
    {
      "pc": "0x00007ff783809420",
      "symbol": "v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312"
    },
    {
      "pc": "0x00007ff783805f44",
      "symbol": "v8::internal::Heap::PageFlagsAreConsistent+3204"
    },
    {
      "pc": "0x00007ff7837fb743",
      "symbol": "v8::internal::Heap::CollectGarbage+1283"
    },
    {
      "pc": "0x00007ff7837f9db4",
      "symbol": "v8::internal::Heap::AddRetainedMap+2452"
    },
    {
      "pc": "0x00007ff78381afbd",
      "symbol": "v8::internal::Factory::NewFillerObject+61"
    },
    {
      "pc": "0x00007ff783581871",
      "symbol": "v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1665"
    },
    {
      "pc": "0x00007ff783d96c4d",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+546637"
    },
    {
      "pc": "0x00007ff783d727bd",
      "symbol": "v8::internal::SetupIsolateDelegate::SetupHeap+398013"
    },
    {
      "pc": "0x000001611a530d48",
      "symbol": ""
    }
  ],
  "javascriptHeap": {
    "totalMemory": 2263302144,
    "totalCommittedMemory": 2263302144,
    "usedMemory": 2242421568,
    "availableMemory": 18023160,
    "memoryLimit": 2197815296,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 262144,
        "committedMemory": 262144,
        "capacity": 32808,
        "used": 32808,
        "available": 0
      },
      "new_space": {
        "memorySize": 33554432,
        "committedMemory": 33554432,
        "capacity": 16759296,
        "used": 15593208,
        "available": 1166088
      },
      "old_space": {
        "memorySize": 1621241856,
        "committedMemory": 1621241856,
        "capacity": 1619376704,
        "used": 1619278928,
        "available": 97776
      },
      "code_space": {
        "memorySize": 692224,
        "committedMemory": 692224,
        "capacity": 470816,
        "used": 470816,
        "available": 0
      },
      "map_space": {
        "memorySize": 1839104,
        "committedMemory": 1839104,
        "capacity": 1434880,
        "used": 1434880,
        "available": 0
      },
      "large_object_space": {
        "memorySize": 605089792,
        "committedMemory": 605089792,
        "capacity": 605066640,
        "used": 605066640,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 622592,
        "committedMemory": 622592,
        "capacity": 544288,
        "used": 544288,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 16759296,
        "used": 0,
        "available": 16759296
      }
    }
  },
  "resourceUsage": {
    "userCpuSeconds": 209.812,
    "kernelCpuSeconds": 2.406,
    "cpuConsumptionPercent": 84.8872,
    "maxRss": 3160449024,
    "pageFaults": {
      "IORequired": 1996465,
      "IONotRequired": 0
    },
    "fsActivity": {
      "reads": 1565,
      "writes": 15
    }
  },
  "libuv": [
  ],
  "workers": [
  ],
  "environmentVariables": {
    "=::": "::\\",
    "=C:": "C:\\Users\\Zzz",
    "=ExitCode": "00000000",
    "ALLUSERSPROFILE": "C:\\ProgramData",
    "APPDATA": "C:\\Users\\Zzz\\AppData\\Roaming",
    "ChocolateyInstall": "C:\\ProgramData\\chocolatey",
    "ChocolateyLastPathUpdate": "132328879249457220",
    "CommonProgramFiles": "C:\\Program Files\\Common Files",
    "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
    "CommonProgramW6432": "C:\\Program Files\\Common Files",
    "COMPUTERNAME": "LAPTOP-XXXXXXXX",
    "ComSpec": "C:\\WINDOWS\\system32\\cmd.exe",
    "dp0": "C:\\Users\\Zzz\\AppData\\Roaming\\npm\\",
    "DriverData": "C:\\Windows\\System32\\Drivers\\DriverData",
    "FPS_BROWSER_APP_PROFILE_STRING": "Internet Explorer",
    "FPS_BROWSER_USER_PROFILE_STRING": "Default",
    "HOMEDRIVE": "C:",
    "HOMEPATH": "\\Users\\Zzz",
    "LOCALAPPDATA": "C:\\Users\\Zzz\\AppData\\Local",
    "LOGONSERVER": "\\\\LAPTOP-XXXXXXXX",
    "NODE_RED_HOME": "C:\\Users\\Zzz\\AppData\\Roaming\\npm\\node_modules\\node-red",
    "NUMBER_OF_PROCESSORS": "8",
    "OneDrive": "C:\\Users\\Zzz\\OneDrive",
    "OS": "Windows_NT",
    "Path": "C:\\Python38\\Scripts\\;C:\\Python38\\;C:\\Program Files\\ImageMagick-7.0.8-Q16;C:\\Program Files (x86)\\iis express\\PHP\\v7.1;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\Bitvise SSH Client;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Users\\Zzz\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Zzz\\AppData\\Local\\GitHubDesktop\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\UniConvertor-2.0rc4\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\nodejs\\;C:\\ProgramData\\chocolatey\\bin;C:\\Users\\Zzz\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Zzz\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\Zzz\\AppData\\Local\\Microsoft\\WindowsApps;;C:\\Users\\Zzz\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Zzz\\AppData\\Roaming\\npm",
    "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JSE;.WSF;.WSH;.MSC;.PY;.PYW",
    "PROCESSOR_ARCHITECTURE": "AMD64",
    "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 142 Stepping 11, GenuineIntel",
    "PROCESSOR_LEVEL": "6",
    "PROCESSOR_REVISION": "8e0b",
    "ProgramData": "C:\\ProgramData",
    "ProgramFiles": "C:\\Program Files",
    "ProgramFiles(x86)": "C:\\Program Files (x86)",
    "ProgramW6432": "C:\\Program Files",
    "PROMPT": "$P$G",
    "PSModulePath": "C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",
    "PUBLIC": "C:\\Users\\Public",
    "SESSIONNAME": "Console",
    "SystemDrive": "C:",
    "SystemRoot": "C:\\WINDOWS",
    "TEMP": "C:\\Users\\Zzz\\AppData\\Local\\Temp",
    "TMP": "C:\\Users\\Zzz\\AppData\\Local\\Temp",
    "USERDOMAIN": "LAPTOP-XXXXXXXX",
    "USERDOMAIN_ROAMINGPROFILE": "LAPTOP-XXXXXXXX",
    "USERNAME": "Zzz",
    "USERPROFILE": "C:\\Users\\Zzz",
    "VBOX_MSI_INSTALL_PATH": "C:\\Program Files\\Oracle\\VirtualBox\\",
    "windir": "C:\\WINDOWS",
    "_prog": "node"
  },
  "sharedObjects": [
    "C:\\Program Files\\nodejs\\node.exe",
    "C:\\WINDOWS\\SYSTEM32\\ntdll.dll",
    "C:\\WINDOWS\\System32\\KERNEL32.DLL",
    "C:\\WINDOWS\\System32\\KERNELBASE.dll",
    "C:\\Program Files\\Bitdefender\\Bitdefender Security\\atcuf\\264654081441149499\\atcuf64.dll",
    "C:\\WINDOWS\\System32\\WS2_32.dll",
    "C:\\WINDOWS\\System32\\RPCRT4.dll",
    "C:\\WINDOWS\\System32\\PSAPI.DLL",
    "C:\\WINDOWS\\System32\\ADVAPI32.dll",
    "C:\\WINDOWS\\System32\\msvcrt.dll",
    "C:\\WINDOWS\\System32\\sechost.dll",
    "C:\\WINDOWS\\System32\\USER32.dll",
    "C:\\WINDOWS\\System32\\win32u.dll",
    "C:\\WINDOWS\\System32\\GDI32.dll",
    "C:\\WINDOWS\\System32\\gdi32full.dll",
    "C:\\WINDOWS\\System32\\msvcp_win.dll",
    "C:\\WINDOWS\\System32\\ucrtbase.dll",
    "C:\\WINDOWS\\System32\\CRYPT32.dll",
    "C:\\WINDOWS\\System32\\MSASN1.dll",
    "C:\\WINDOWS\\System32\\bcrypt.dll",
    "C:\\WINDOWS\\SYSTEM32\\dbghelp.dll",
    "C:\\WINDOWS\\SYSTEM32\\IPHLPAPI.DLL",
    "C:\\WINDOWS\\SYSTEM32\\USERENV.dll",
    "C:\\WINDOWS\\System32\\profapi.dll",
    "C:\\WINDOWS\\SYSTEM32\\WINMM.dll",
    "C:\\WINDOWS\\SYSTEM32\\WINMMBASE.dll",
    "C:\\WINDOWS\\System32\\cfgmgr32.dll",
    "C:\\WINDOWS\\System32\\bcryptPrimitives.dll",
    "C:\\WINDOWS\\System32\\IMM32.DLL",
    "C:\\WINDOWS\\System32\\powrprof.dll",
    "C:\\WINDOWS\\System32\\UMPDC.dll",
    "C:\\WINDOWS\\SYSTEM32\\CRYPTBASE.DLL",
    "C:\\WINDOWS\\system32\\uxtheme.dll",
    "C:\\WINDOWS\\System32\\combase.dll",
    "C:\\WINDOWS\\system32\\mswsock.dll",
    "C:\\WINDOWS\\System32\\kernel.appcore.dll",
    "\\\\?\\C:\\Users\\Zzz\\AppData\\Roaming\\npm\\node_modules\\node-red\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node",
    "C:\\WINDOWS\\SYSTEM32\\ntmarta.dll",
    "C:\\WINDOWS\\system32\\napinsp.dll",
    "C:\\WINDOWS\\system32\\pnrpnsp.dll",
    "C:\\WINDOWS\\SYSTEM32\\DNSAPI.dll",
    "C:\\WINDOWS\\System32\\NSI.dll",
    "C:\\WINDOWS\\System32\\winrnr.dll",
    "C:\\WINDOWS\\system32\\NLAapi.dll",
    "C:\\WINDOWS\\system32\\wshbth.dll",
    "C:\\Program Files\\Bonjour\\mdnsNSP.dll",
    "C:\\WINDOWS\\SYSTEM32\\dhcpcsvc6.DLL",
    "C:\\WINDOWS\\SYSTEM32\\dhcpcsvc.DLL",
    "C:\\Windows\\System32\\rasadhlp.dll",
    "C:\\WINDOWS\\System32\\fwpuclnt.dll"
  ]
}

I think what youre seeing is node getting stuck in a loop (and therefore unable to update the status of the request node from requesting)

PROOF: disconnect the "Get table" function & run it - the request operates normally.

There are a few do...while loops in your function "Get table" - this will be the cause. 100% certain!

Put MAX counter in your loops (set for say max 1000 iterations (should be enough right?)) then if you hit MAX, send a node.warn("Breaking out of do..while loop 1 as it has done 1000 iterations! check this code - its not right!"); then exit the loop (to prevent node-red locking up.

In fact, litter your code with node.warn("thisVal=" + thisVal) type calls to see whats going on.

My suspicion you're not doing the regex correctly and getting stuck in loop.

PS, you might actually be able to do most of this using the html node (no regex required)

1 Like

Thank you!
:flushed:

If somebody wishes to use the waste calendar of RMN in The Netherlands:

[{"id":"a28c2875.4c7198","type":"function","z":"70d8a976.18205","name":"Get table","func":"const patt0 = /\\r?\\n|\\r/g;                 // to remove newlines\nconst patt1 = /<h1>Wanneer(.+?)<footer/;   // find table\nconst patt2 = /<li>(.+?)<\\/li/g;           // find rows\nconst patt3 = /<img\\ssrc=\"([^\"]*)\"/;       // find icons\nconst patt4 = /<i\\sclass=\"date\">([^<]*)</; // find dates\nconst patt5 = /<i>([^<]*)</                // find waste\nvar re1, re2, re3, re4, re5;\nvar dtm = msg.today;\nvar txt = \"\";\nvar i, j;\nvar all_ok = true;\nvar row = [];\nvar payload = \"<table>\";\n\nmsg.rmnStatus = false;\n\nvar html = msg.payload;\nhtml = html.replace(patt0, \"\");\n\nre1 = patt1.exec(html);\n\nif (re1) {\n    txt = re1[1].toString();\n\n    // while re2: find rows\n    do {\n        re2 = patt2.exec(txt);\n        if (re2) {\n            row.push(re2[1].toString());\n        }\n    } while (re2)\n}\n\nfor (i = 0; i < row.length; i++) {\n    var line = '<tr>';\n    var usable = true;\n\n    txt = row[i];\n    re3 = patt3.exec(txt);\n    if (re3) {\n        line += '<td width=\"15%\"><img src=\"' + re3[1] + '\" width=\"35\" height=\"35\" aria-hidden=\"true\" /></td>';\n    }\n    else {\n        usable = false;\n    }\n\n    re4 = patt4.exec(txt);\n    if (re4) {\n        line += '<td width=\"35%\">' + re4[1] + '</td>';\n    }\n    else {\n        usable = false;\n    }\n\n    re5 = patt5.exec(txt);\n    if (re5) {\n        line += '<td width=\"50%\">' + re5[1] + '</td>';\n    }\n    else {\n        usable = false;\n    }\n\n    if(usable) {\n        line += \"</tr>\"\n        payload += line;\n    }\n}\n\npayload += \"</table>\";\n\nif (row.length >= 1) {\n    msg.rmnStatus = true;\n}\n\nmsg.payload = payload;\n\nreturn msg;","outputs":1,"noerr":0,"x":320,"y":200,"wires":[["edd1122.95980f","8b8f4000.fec468","d39d1b9d.c65dc"]]}]

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