# How to: login, navigate, GET html, find in string

**URL:** <https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435>\
**Category:** General\
**Created:** [25 September 2018 09:59 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435 "2018-09-25T09:59:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alanca](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@alanca](https://discourse.nodered.org/u/alanca)\
**Post date:** [25 September 2018 09:59 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/1 "2018-09-25T09:59:01Z")

</div>

Hello, I'm trying to create a flow in which I

1. inject an hourly request to a HTTP node
2. which logs in onto a web page,
3. afterwards navigate to a different page on that website using a URL (which requires being logged in first),
4. GET all the html code
5. Convert it to a string
6. find the word 'connected' in this string
7. have a debug message with a bool showing if 'connected' was found or not
8. I can link this to an email notification via smtp later, with an existing and configured email node

I tried experimenting with a HTML node that searches for a specific CSS selector but in all cases it couldn't find it or it returned an empty array while it certainly is not.

Any help or example flows on this would be helpful. I need to add this flow to the existing ones which where set up by someone who left the project team and I am new to Node-RED.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [25 September 2018 10:43 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/2 "2018-09-25T10:43:34Z")

</div>

add a debug to the http nodes and set it to display all. Check that you are actually receiving the data you think you are.

---

<div class="post-metadata">

**Author:** ![alanca](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@alanca](https://discourse.nodered.org/u/alanca)\
**Post date:** [25 September 2018 11:03 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/3 "2018-09-25T11:03:43Z")

</div>

I receive the full page in HTML, I have no issues with that.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [25 September 2018 11:47 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/4 "2018-09-25T11:47:27Z")

</div>

So the only bit in the Title that you need help with is find in string?

---

<div class="post-metadata">

**Author:** ![alanca](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@alanca](https://discourse.nodered.org/u/alanca)\
**Post date:** [25 September 2018 12:07 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/5 "2018-09-25T12:07:01Z")

</div>

I need help with #6 (finding the word 'connected' in the string) and with #3, navigating to a different page after logging in. I don't know how to place my nodes for that. Would two http request nodes in a row work for this? One logging in and one navigating to a nested page on that website?

Here's a screenshot of what I've been trying:

 ![node-red%20flow%20troubleshooting](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4d6207452848c586f1a8946c51acde4c50c4ab27.png)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [25 September 2018 19:15 UTC](https://discourse.nodered.org/t/how-to-login-navigate-get-html-find-in-string/3435/6 "2018-09-25T19:15:58Z")

</div>

Yes, you can make two `http request` node calls in a row, but you _may_ need to clear the `msg.req` and/or `msg.res` properties between calls (at least, you used to). Otherwise, the second node tries to reuse some of the first node's properties. I'm guessing that only Nick would have a definitive answer for why this is (or no longer is) necessary... but if the second call fails, you could try using a `change` node to delete those properties after the first call.
