# Get data from a website using the Http request node

**URL:** https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086
**Category:** General
**Tags:** http-request
**Created:** [4 November 2022 14:00 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086 "2022-11-04T14:00:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Engi](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@Engi](https://discourse.nodered.org/u/Engi)
#### Post date: [4 November 2022 14:00 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/1 "2022-11-04T14:00:04Z")

</div>

Hi, I am trying to pull data from a website using the http request node and a HTML node like they do in this example [Simple GET request : Node-RED](https://cookbook.nodered.org/http/simple-get-request), However my data is in a jstcache variable instead of a class as shown in the picture below:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/20dde83202d8221dad9c95166d1ae0ca4a1f3676.png)  
The data I am trying to pull is jstcache = 320, but whenever I pull it now it just gives me an empty array. Is there a way to access this data in node red?

I am new with anything html so any help would be appreciated,  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [4 November 2022 14:20 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/2 "2022-11-04T14:20:05Z")

</div>

The selector would be `span[jstcache=320]` untested as you supplied no link or copyable data.

---

<div class="post-metadata">

### Author: ![Engi](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@Engi](https://discourse.nodered.org/u/Engi)
#### Post date: [4 November 2022 16:36 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/3 "2022-11-04T16:36:23Z")

</div>

Sorry I didn't provide much info, the original had a bit of personal information, but here is the flow and a link of a more general test.

Site URL:  
"[Google Maps](https://www.google.ca/maps/dir/Laval/Montreal,+QC/@45.5590971,-73.8519568,11z/data=!4m14!4m13!1m5!1m1!1s0x4cc92107b4dfda6b:0x2eb4b26fe333c419!2m2!1d-73.712409!2d45.6066487!1m5!1m1!1s0x4cc91a541c64b70d:0x654e3138211fefef!2m2!1d-73.5673919!2d45.5018869!3e3?hl=en)"

Flow:

```auto
[
    {
        "id": "c1d14628c2369d80",
        "type": "inject",
        "z": "235adc4f290fa86f",
        "name": "make request",
        "props": [
            {
                "p": "payload",
                "v": "",
                "vt": "date"
            },
            {
                "p": "topic",
                "v": "",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 270,
        "y": 160,
        "wires": [
            [
                "90f9e6f8756f49cb"
            ]
        ]
    },
    {
        "id": "90f9e6f8756f49cb",
        "type": "http request",
        "z": "235adc4f290fa86f",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://www.google.ca/maps/dir/Laval/Montreal,+QC/@45.5590971,-73.8519568,11z/data=!4m14!4m13!1m5!1m1!1s0x4cc92107b4dfda6b:0x2eb4b26fe333c419!2m2!1d-73.712409!2d45.6066487!1m5!1m1!1s0x4cc91a541c64b70d:0x654e3138211fefef!2m2!1d-73.5673919!2d45.5018869!3e3?hl=en",
        "tls": "",
        "persist": false,
        "proxy": "",
        "authType": "",
        "senderr": false,
        "x": 450,
        "y": 160,
        "wires": [
            [
                "c847c70b23acc5a8"
            ]
        ]
    },
    {
        "id": "9a5642cb78d66133",
        "type": "debug",
        "z": "235adc4f290fa86f",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "false",
        "x": 830,
        "y": 160,
        "wires": []
    },
    {
        "id": "c847c70b23acc5a8",
        "type": "html",
        "z": "235adc4f290fa86f",
        "name": "",
        "property": "",
        "outproperty": "",
        "tag": "span[jstcache=\"1492\"]",
        "ret": "text",
        "as": "single",
        "x": 640,
        "y": 160,
        "wires": [
            [
                "9a5642cb78d66133"
            ]
        ]
    }
]

```

I am still encountering the issue where the debug will be an empty array.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/4777cbd1d5d75d76fe680d8cb30da03017fc5e1a.png)

The info I am trying to access of this page is the highlighted code below:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b26dd2f77b9d84fffe0de8627d07e51f1afb59e1.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [4 November 2022 17:04 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/4 "2022-11-04T17:04:50Z")

</div>

The issue is Google map page is generated with Javascript, in the browser that is fine, unfortunately the http request node does not run the javascript, so using the http request node is not going to work.

You may be lucky and find some link in the developer console of your browser that may load the data, but I doubt it.

You could try some contrib nodes that can make a http request and execute the scripts, to get the final loaded page. Search for Nbrowser, Puppeteer or [broswer.](https://flows.nodered.org/search?term=browser&type=node&type=flow&type=collection)

---

<div class="post-metadata">

### Author: ![Engi](https://avatars.discourse-cdn.com/v4/letter/e/ac91a4/32.png) [@Engi](https://discourse.nodered.org/u/Engi)
#### Post date: [4 November 2022 18:18 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/5 "2022-11-04T18:18:55Z")

</div>

Okay, thanks

---

<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: [3 January 2023 18:18 UTC](https://discourse.nodered.org/t/get-data-from-a-website-using-the-http-request-node/70086/6 "2023-01-03T18:18:59Z")

</div>

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