My first time to use html parser

Hi,

It is my first time to use html parser. I am trying to get:

Binance Adds BNX, YFI & More Pairs on Cross Margin & Isolated Margin

html part:

<div data-bn-type="text" class="css-f94ykk">Binance Adds BNX, YFI &amp; More Pairs on Cross Margin &amp; Isolated Margin<h6 data-bn-type="text" class="css-eoufru">2023-03-01</h6></div>

my selector in html parser is : div.css-f94ykk
but the result is empty.

source:New Cryptocurrency Listing | Binance Support

Thanks for the help in advance.
Regards,
Nuri

Hello .. the data seem to be in a script tag with id __APP_DATA before being populated with javascript to the divs. So the css-f94ykk selector doesnt return anything because the divs dont exist at that time.

After parsing the json you can find what you need in msg.payload.routeProps.ce50.catalogs[0].articles

Here is how i managed to get them

[{"id":"b68a67f5ebfd6110","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":1700,"wires":[["22eb2d3563a89555"]]},{"id":"22eb2d3563a89555","type":"http request","z":"54efb553244c241f","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.binance.com/en/support/announcement/new-cryptocurrency-listing?c=48&navId=48","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":410,"y":1700,"wires":[["d3dbe4b9258cdd30"]]},{"id":"d3dbe4b9258cdd30","type":"html","z":"54efb553244c241f","name":"","property":"payload","outproperty":"payload","tag":"#__APP_DATA","ret":"html","as":"single","x":600,"y":1700,"wires":[["ec9ac7ab851b8035","7c1bbe929e5b418e"]]},{"id":"209d8b8f4d3ad74a","type":"debug","z":"54efb553244c241f","name":"debug 29","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":960,"y":1700,"wires":[]},{"id":"ec9ac7ab851b8035","type":"debug","z":"54efb553244c241f","name":"debug 30","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":770,"y":1620,"wires":[]},{"id":"7c1bbe929e5b418e","type":"function","z":"54efb553244c241f","name":"parse JSON","func":"msg.payload = JSON.parse(msg.payload[0].replace(/&quot;/g, '\"'))\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":1700,"wires":[["209d8b8f4d3ad74a"]]}]

image

1 Like

WOW!
Just WOW. You did it man.
Thanks for this great support. 5star.

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