# Select one specific index from array

**URL:** <https://discourse.nodered.org/t/select-one-specific-index-from-array/35549>\
**Category:** General\
**Created:** [8 November 2020 14:20 UTC](https://discourse.nodered.org/t/select-one-specific-index-from-array/35549 "2020-11-08T14:20:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliver.es](https://avatars.discourse-cdn.com/v4/letter/o/dc4da7/32.png) [@oliver.es](https://discourse.nodered.org/u/oliver.es)\
**Post date:** [8 November 2020 14:20 UTC](https://discourse.nodered.org/t/select-one-specific-index-from-array/35549/1 "2020-11-08T14:20:13Z")

</div>

Hi,

I'm a newbie in Node-RED. My first exercise is to scrap the HTML page and read the specific value in the table.

> **[Olomouc-Nové Sady tok](http://hydro.chmi.cz/hpps/hpps_prfdyn.php?seq=2505266)**

This is a government page that displays the river level in your city. Because they are not using a lot of CSS classes and IDs, the reading of the HTML table is difficult. The table also contains historical and unnecessary data, always wrapped in a td tag.

I was created HTML node with this selector: table.stdstationtbl\>tr\>td\>div.center\_text\>table\>tr\>td

At the output, there is an array with indexes 0 - 115 but I need only one value - index no. 1. (see attached screenshot).

 ![Snímek obrazovky 2020-11-08 v 15.08.51](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8a97801718e1d4e66a9311ee5ab438272dae8a16.png)

I tried to modify the selector as an example **td[1]** or (1) at the end, but in all cases, there is an error or empty response.

It is possible to select a specific (only one) value from an array? Or set n-th td tag in HTML (skip first two tags for example)?

 ![Snímek obrazovky 2020-11-08 v 15.22.45](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c47392ed34b54240a785f844e8899fefa37abd20.png)

I want to do not code functions.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [8 November 2020 14:51 UTC](https://discourse.nodered.org/t/select-one-specific-index-from-array/35549/2 "2020-11-08T14:51:58Z")

</div>

Welcome to the forum.

You can use a Change node to Move `msg.payload[1]` into `msg.payload`.  
Have a look at the node red docs page a Working with Messages which will give you help with that sort of thing.  
In fact it would be a good idea to watch the Node-red Essentials videos linked from the docs.

---

<div class="post-metadata">

**Author:** ![oliver.es](https://avatars.discourse-cdn.com/v4/letter/o/dc4da7/32.png) [@oliver.es](https://discourse.nodered.org/u/oliver.es)\
**Post date:** [8 November 2020 15:09 UTC](https://discourse.nodered.org/t/select-one-specific-index-from-array/35549/3 "2020-11-08T15:09:11Z")

</div>

Thank you. It works. Now I have river level in Grafana.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 November 2020 15:09 UTC](https://discourse.nodered.org/t/select-one-specific-index-from-array/35549/4 "2020-11-22T15:09:17Z")

</div>

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