# Trying to receive Data from Website

**URL:** https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989
**Category:** General
**Created:** [11 March 2020 16:05 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989 "2020-03-11T16:05:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Montezoma](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Montezoma](https://discourse.nodered.org/u/Montezoma)
#### Post date: [11 March 2020 16:05 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/1 "2020-03-11T16:05:26Z")

</div>

Hi, I'm trying to receive data from a website using the Http request Node from [https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE](https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE). When accessing the URL on chrome, I can clearly see the data I want to access in a JSON format. When using Inject timestamp -\> HTTP request -\> debug I don't receive the data... Does anyone have a clue what I am missing?

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [11 March 2020 16:16 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/2 "2020-03-11T16:16:04Z")

</div>

When I tried it - I got this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/780ce430d656896c21bfa41e62f6f762f1c0c4ce.jpeg)

---

<div class="post-metadata">

### Author: ![Montezoma](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Montezoma](https://discourse.nodered.org/u/Montezoma)
#### Post date: [11 March 2020 16:19 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/3 "2020-03-11T16:19:21Z")

</div>

Yes I got the same response. However when visiting the URL in the browser the data I want is clearly visible. I tried to get the data using Python and it worked somehow.

---

<div class="post-metadata">

### Author: ![Montezoma](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Montezoma](https://discourse.nodered.org/u/Montezoma)
#### Post date: [11 March 2020 16:23 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/4 "2020-03-11T16:23:20Z")

</div>

> [@Montezoma](#):
>
> [https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE](https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE)

###Python3

```auto
from urllib.request import urlopen, Request
url = "https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE"
request = Request(url)
response = urlopen(request)
html = response.read()
response.close()
print(html)

```

##### 

returns the content of the URL.. I would like to use Node Red instead of Python and I haven't found out how to get the same response...

---

<div class="post-metadata">

### Author: ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)
#### Post date: [11 March 2020 18:01 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/5 "2020-03-11T18:01:23Z")

</div>

> [@Montezoma](#):
>
> When accessing the URL on chrome, I can clearly see the data I want to access in a JSON format.

Perhaps you could trick the server by adding a message header with a fake user-agent ? I see that the response from server is gziped. You will need to unzip the reply.

 ![http-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/808ad02976d519c03775ea0e764b8df38e89be25.png)

---

<div class="post-metadata">

### Author: ![Montezoma](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Montezoma](https://discourse.nodered.org/u/Montezoma)
#### Post date: [11 March 2020 18:38 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/6 "2020-03-11T18:38:36Z")

</div>

Thank you for the input Andrei! I will try to test your idea.

---

<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: [11 March 2020 18:41 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/7 "2020-03-11T18:41:16Z")

</div>

Try this flow, it works (just learned from another topic):

```auto
[{"id":"a288ed10.713a5","type":"inject","z":"ab533118.ebed78","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":144,"y":264,"wires":[["726ecebb.3baf88"]]},{"id":"726ecebb.3baf88","type":"function","z":"ab533118.ebed78","name":"","func":"\nurl = `\"https://api.cellmapper.net/v6/getSite?MCC=228&MNC=1&Site=00000&RAT=LTE\" \\\n-XGET \\\n-H 'Cookie: JSESSIONID=node01wwvg93m60l2r1a36c8iewh3mk8349.node0' \\\n-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \\\n-H 'Host: api.cellmapper.net' \\\n-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Safari/605.1.15' \\\n-H 'Accept-Language: en-us' \\\n-H 'Accept-Encoding: gzip, deflate, br' \\\n-H 'Connection: keep-alive'`\nreturn {payload:url};","outputs":1,"noerr":0,"x":312,"y":264,"wires":[["47a47836.68e428"]]},{"id":"47a47836.68e428","type":"exec","z":"ab533118.ebed78","command":"curl --compressed","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":498,"y":264,"wires":[["19491de3.38a09a"],[],[]]},{"id":"e423b027.553988","type":"debug","z":"ab533118.ebed78","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":818,"y":264,"wires":[]},{"id":"19491de3.38a09a","type":"json","z":"ab533118.ebed78","name":"","property":"payload","action":"","pretty":false,"x":674,"y":264,"wires":[["e423b027.553988"]]}]

```

---

<div class="post-metadata">

### Author: ![Montezoma](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@Montezoma](https://discourse.nodered.org/u/Montezoma)
#### Post date: [12 March 2020 07:14 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/8 "2020-03-12T07:14:08Z")

</div>

Thank you very much bakman2! You just solved my problem!

---

<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: [26 March 2020 07:14 UTC](https://discourse.nodered.org/t/trying-to-receive-data-from-website/22989/9 "2020-03-26T07:14:10Z")

</div>

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