Node-red: parse HTML to get data
I’m trying to get some information from this site
I’ve created a very simple flow in node-red but in the output I am not able to find the values.
this is what I am looking for:
path:
div.col-xs-12.col-sm-8 > div:nth-child(2) > div:nth-child(1) > table > tbody > tr:nth-child(2)")
and
div.col-xs-12.col-sm-8 > div:nth-child(2) > div:nth-child(1) > table > tbody > tr:nth-child(3)")
and this is my flow in node-red:
[{"id":"653dfce2813a1724","type":"tab","label":"bonbast.com","disabled":false,"info":"","env":[]},{"id":"d88dd470.0ac7b8","type":"inject","z":"653dfce2813a1724","name":"make request","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":150,"y":240,"wires":[["874a3d4e.9b666"]]},{"id":"874a3d4e.9b666","type":"http request","z":"653dfce2813a1724","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.bonbast.com/","tls":"","persist":true,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":314.5,"y":240,"wires":[["0e99fe6a44cb90ad"]]},{"id":"7403c68f.21d7c8","type":"debug","z":"653dfce2813a1724","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":180,"wires":[]},{"id":"0e99fe6a44cb90ad","type":"html","z":"653dfce2813a1724","name":"","property":"payload","outproperty":"payload","tag":"table.table.table-condensed>tbody>tr>td","ret":"html","as":"single","x":640,"y":180,"wires":[["7403c68f.21d7c8"]]}]
but what I receive in output of my flow looks like this and the values are empty:
Best regards, Shahram
Read more here: Source link