18.12.2022, 09:51
I'm looking for a way to grab the value of the 3th parent and 2th child item of a string. Below an example of the data i get. The value i need is marked in red. It's not possible to use the id's as they change all the time. With css it's done like this item:nth-child(3) item:nth-child(2) but how is it done in Lua?
<values>
<item id='0x8764bc'>
<item id='0x87676c'>
<value>32.5°C</value>
</item>
<item id='0x87de1c'>
<value>28.6°C</value>
</item>
<item id='0x87de64'>
<value>28.4°C</value>
</item>
<item id='0x876724'>
<value>62.7°C</value>
</item>
</item>
<item id='0x876504'>
<item id='0x8b7ab4'>
<value>Aan</value>
</item>
<item id='0x87e0d4'>
<value>Aan</value>
</item>
</item>
<item id='0x8765dc'>
<item id='0x878554'>
<value>Uit</value>
</item>
<item id='0x861b84'>
<value>Aan</value>
</item>
<item id='0x861bcc'>
<value>Aan</value>
</item>
<item id='0x87850c'>
<value>Aan</value>
</item>
</item>
</values>
<values>
<item id='0x8764bc'>
<item id='0x87676c'>
<value>32.5°C</value>
</item>
<item id='0x87de1c'>
<value>28.6°C</value>
</item>
<item id='0x87de64'>
<value>28.4°C</value>
</item>
<item id='0x876724'>
<value>62.7°C</value>
</item>
</item>
<item id='0x876504'>
<item id='0x8b7ab4'>
<value>Aan</value>
</item>
<item id='0x87e0d4'>
<value>Aan</value>
</item>
</item>
<item id='0x8765dc'>
<item id='0x878554'>
<value>Uit</value>
</item>
<item id='0x861b84'>
<value>Aan</value>
</item>
<item id='0x861bcc'>
<value>Aan</value>
</item>
<item id='0x87850c'>
<value>Aan</value>
</item>
</item>
</values>