Hi All , hope everyone is safe
first post here , hopefully I can follow the forum procedures . I started using Node Red during lockdown and absolutely love it .
I am trying to webscrape/Parse a website . I am battling however to retrieve html attributes. from the Div class related-Item I need to try get the attribute data-adid. I have no problem retrieving other information , just attributes .
data-adid="1007196353500912404170409"
<div class="related-item has-hover has-actions-bar" **data-adid="1007196353500912404170409"** data-short-id="719635350" data-is-partner="false" data-ad-type="SRPGallery" data-seller-name="Sasha">
[{"id":"8c313e8.b5fcfc","type":"http request","z":"7c14918b.c96f7","name":"","method":"GET","ret":"txt","paytoqs":false,"url":"https://www.gumtree.co.za/s-western-cape/v1l3100001p1?q=engel+fridge","tls":"","persist":false,"proxy":"","authType":"","x":230,"y":260,"wires":[["341b8675.6fe6ea"]]},{"id":"eb50ddda.b8698","type":"inject","z":"7c14918b.c96f7","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":180,"wires":[["8c313e8.b5fcfc"]]},{"id":"341b8675.6fe6ea","type":"html","z":"7c14918b.c96f7","name":"","property":"payload","outproperty":"payload","tag":"div.related-item","ret":"html","as":"multi","x":140,"y":360,"wires":[["a784b43c.cf06b8","d367928.3c7cb7","f431e9a8.e68d38","9adc477e.e224f8"]]},{"id":"7e7005af.e534dc","type":"debug","z":"7c14918b.c96f7","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":420,"wires":[]},{"id":"a784b43c.cf06b8","type":"html","z":"7c14918b.c96f7","name":"title","property":"payload","outproperty":"payload","tag":"a","ret":"text","as":"multi","x":350,"y":400,"wires":[["d6142b69.4f8a28"]]},{"id":"d367928.3c7cb7","type":"html","z":"7c14918b.c96f7","name":"price","property":"payload","outproperty":"payload","tag":"div.price","ret":"text","as":"multi","x":350,"y":360,"wires":[["d6142b69.4f8a28"]]},{"id":"f431e9a8.e68d38","type":"html","z":"7c14918b.c96f7","name":"description","property":"payload","outproperty":"payload","tag":"span.description-text","ret":"text","as":"multi","x":370,"y":440,"wires":[["d6142b69.4f8a28"]]},{"id":"d6142b69.4f8a28","type":"join","z":"7c14918b.c96f7","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"payload","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":570,"y":420,"wires":[["7e7005af.e534dc"]]},{"id":"9adc477e.e224f8","type":"html","z":"7c14918b.c96f7","name":"place","property":"payload","outproperty":"payload","tag":"div.location-date","ret":"text","as":"multi","x":350,"y":480,"wires":[["d6142b69.4f8a28"]]}]
I am also using a join to create an array , I see the array created is not always in order due to it arriving at different times as the join . I tried using a key/object in join but didn't seem to get the desired output .
Many Thanks
Mark