# Not able to get data from Weather.gov

**URL:** <https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803>\
**Category:** General\
**Created:** [8 October 2018 22:10 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803 "2018-10-08T22:10:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rednecknerd](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@Rednecknerd](https://discourse.nodered.org/u/Rednecknerd)\
**Post date:** [8 October 2018 22:10 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/1 "2018-10-08T22:10:06Z")

</div>

Hi, new user here. Still making my way through the tuts.

I need to get the Barometric data from one of the following sites.

[https://w1.weather.gov/data/obhistory/KRVS.html](https://w1.weather.gov/data/obhistory/KRVS.html)  
or  
[https://w1.weather.gov/xml/current\_obs/KRVS.xml](https://w1.weather.gov/xml/current_obs/KRVS.xml)

 ![HTTP%20node%20red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5bad406dbf4c7ea630c321dc6c89ef0651d0db80.png) what I get when I try the HTML css node.

Not sure about the xml node yet.

I have managed to get the HTML to work on a HTTP site, collecting the date and time.  
[http://www.time.org/zones/US/Central.php](http://www.time.org/zones/US/Central.php)

Could my trouble be from the site being HTTPS?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 October 2018 22:28 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/2 "2018-10-08T22:28:31Z")

</div>

You are getting a `403 - The server is refusing the request.`  
I get the same thing which leads me to believe that the server isn't letting bots access. I would guess that the server is determining that this isn't coming from a browser and so it shuts it out.

Figuring out away around that is beyoud me though 🥴 but someone else may have an tide of how to do it.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [8 October 2018 22:39 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/3 "2018-10-08T22:39:53Z")

</div>

You might be able to spoof the user-agent of something like firefox.

---

<div class="post-metadata">

**Author:** ![Rednecknerd](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@Rednecknerd](https://discourse.nodered.org/u/Rednecknerd)\
**Post date:** [8 October 2018 22:48 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/4 "2018-10-08T22:48:08Z")

</div>

Makes sense they would block bots.

I will look into the spoofing.

---

<div class="post-metadata">

**Author:** ![Rednecknerd](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@Rednecknerd](https://discourse.nodered.org/u/Rednecknerd)\
**Post date:** [8 October 2018 22:54 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/5 "2018-10-08T22:54:13Z")

</div>

Tried a different site.

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

Now to figure out how to get just what I want out of that string.  
the A2983 is what I'm after.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [8 October 2018 23:04 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/6 "2018-10-08T23:04:26Z")

</div>

You may be able to break it into parts using a split node and using the space as your delimiter. You can then filter using a switch node to only pass that particular msg.parts.index.

---

<div class="post-metadata">

**Author:** ![Rednecknerd](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@Rednecknerd](https://discourse.nodered.org/u/Rednecknerd)\
**Post date:** [8 October 2018 23:05 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/7 "2018-10-08T23:05:23Z")

</div>

First I am trying to get just Payload 3. But I don't know the proper input yet for that!

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [8 October 2018 23:21 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/8 "2018-10-08T23:21:34Z")

</div>

If you hover over the message part that you want to filter you can get its address by hovering over that part and clicking the "copy path" button I circled in the screenshot. You can then use the change and switch nodes to play with it.

![24%20PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/455717069b240489b8c0af08df4884146d39caca.png)

---

<div class="post-metadata">

**Author:** ![Rednecknerd](https://avatars.discourse-cdn.com/v4/letter/r/b77776/32.png) [@Rednecknerd](https://discourse.nodered.org/u/Rednecknerd)\
**Post date:** [8 October 2018 23:25 UTC](https://discourse.nodered.org/t/not-able-to-get-data-from-weather-gov/3803/9 "2018-10-08T23:25:04Z")

</div>

I knew about the copy path but didn't know where to put it!

Using the change node got me to where I wanted! Thanks!
