# HTML Node - Problem with CSS selector

**URL:** https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657
**Category:** General
**Created:** [9 September 2020 18:38 UTC](https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657 "2020-09-09T18:38:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bigmadgaga](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bigmadgaga](https://discourse.nodered.org/u/bigmadgaga)
#### Post date: [9 September 2020 18:38 UTC](https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657/1 "2020-09-09T18:38:39Z")

</div>

Hi@all.

I am a newbie in node-red.I try to scrape a few elements of a website. Therefore i created a selector to define the element i want to read out. When i check my created selector with the chrome devoloper tool the right HTML elements are marked up.

But my flow itself always delivers an "empty" in my debug node. I don't understand, what i am doing wrong.

Thanks in advance

bigmadgaga

The CSS selector:

```auto
html>body>div.container>div.content>div.col-md-12.col-sm-12.col-xs-12>div.project_table_wrapper>div.project_table>table>tbody>tr.clickable-row>td.tcol_id

```

The flow

```auto
[{"id":"1b510b24.60b2d5","type":"inject","z":"1723e563.48115b","name":"","props":[{"p":"provider","v":"","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":140,"y":160,"wires":[["c0a51478.248928"]]},{"id":"c0a51478.248928","type":"http request","z":"1723e563.48115b","name":"constaff","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://www.constaff.com/projektangebote/","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":160,"wires":[["50cd306.342e0d"]]},{"id":"4260116f.548ea","type":"debug","z":"1723e563.48115b","name":"","active":true,"tosidebar":false,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":160,"wires":[]},{"id":"50cd306.342e0d","type":"switch","z":"1723e563.48115b","name":"check HTTP status","property":"statusCode","propertyType":"msg","rules":[{"t":"neq","v":"200","vt":"str"},{"t":"eq","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":160,"wires":[["4522eae6.f03f24"],["4a4de365.8de1ec","310a0f48.4fd32"]]},{"id":"b033d97e.4b0eb8","type":"debug","z":"1723e563.48115b","name":"","active":true,"tosidebar":false,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":120,"wires":[]},{"id":"4522eae6.f03f24","type":"change","z":"1723e563.48115b","name":"mistake","rules":[{"t":"set","p":"payload","pt":"msg","to":"topit-services HTTP Request fehlerhaft","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":120,"wires":[["b033d97e.4b0eb8"]]},{"id":"4a4de365.8de1ec","type":"change","z":"1723e563.48115b","name":"success","rules":[{"t":"set","p":"payload","pt":"msg","to":"constaff HTTP erfolgreich","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":160,"wires":[["4260116f.548ea"]]},{"id":"35ca9080.58332","type":"debug","z":"1723e563.48115b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":300,"wires":[]},{"id":"310a0f48.4fd32","type":"html","z":"1723e563.48115b","name":"","property":"payload","outproperty":"payload","tag":"#html>body>div.container>div.content>div.col-md-12.col-sm-12.col-xs-12>div.project_table_wrapper>div.project_table>table>tbody>tr.clickable-row>td.tcol_id","ret":"text","as":"single","x":590,"y":220,"wires":[["35ca9080.58332"]]}]

```

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [9 September 2020 18:45 UTC](https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657/2 "2020-09-09T18:45:23Z")

</div>

You can use `.tcol_id` as the selector, you will get an array.

Note for checking the 200, you should use a numeric comparison.

---

<div class="post-metadata">

### Author: ![bigmadgaga](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bigmadgaga](https://discourse.nodered.org/u/bigmadgaga)
#### Post date: [9 September 2020 19:09 UTC](https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657/3 "2020-09-09T19:09:28Z")

</div>

Oooouuuuuuch!!! So easy.

And it works!

@bakman2: Thank you!

---

<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: [23 September 2020 19:09 UTC](https://discourse.nodered.org/t/html-node-problem-with-css-selector/32657/4 "2020-09-23T19:09:38Z")

</div>

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